mirror of
https://github.com/PowerShell/Win32-OpenSSH.git
synced 2025-07-22 21:45:09 +02:00
added waitpid() and removed its dependency from bsdcompat
This commit is contained in:
parent
f04dc7c355
commit
936508e00c
@ -1203,7 +1203,7 @@
|
||||
#define HAVE_VSNPRINTF 1
|
||||
|
||||
/* Define to 1 if you have the `waitpid' function. */
|
||||
/* #undef HAVE_WAITPID */
|
||||
#define HAVE_WAITPID 1
|
||||
|
||||
/* Define to 1 if you have the `_getlong' function. */
|
||||
/* #undef HAVE__GETLONG */
|
||||
@ -1681,8 +1681,6 @@
|
||||
#define WIN32_ZLIB_NO 1
|
||||
#define USE_MSCNG 1
|
||||
|
||||
typedef unsigned long pid_t;
|
||||
|
||||
#ifndef ssize_t
|
||||
#ifdef _WIN64
|
||||
typedef __int64 ssize_t;
|
||||
|
@ -157,6 +157,7 @@
|
||||
<ClInclude Include="$(OpenSSH-Src-Path)\contrib\win32\win32compat\inc\sys\socket.h" />
|
||||
<ClInclude Include="$(OpenSSH-Src-Path)\contrib\win32\win32compat\inc\sys\stat.h" />
|
||||
<ClInclude Include="$(OpenSSH-Src-Path)\contrib\win32\win32compat\inc\sys\time.h" />
|
||||
<ClInclude Include="$(OpenSSH-Src-Path)\contrib\win32\win32compat\inc\sys\wait.h" />
|
||||
<ClInclude Include="$(OpenSSH-Src-Path)\contrib\win32\win32compat\inc\unistd.h" />
|
||||
<ClInclude Include="$(OpenSSH-Src-Path)\contrib\win32\win32compat\inc\w32posix.h" />
|
||||
<ClInclude Include="$(OpenSSH-Src-Path)\contrib\win32\win32compat\inc\poll.h" />
|
||||
|
@ -40,6 +40,9 @@
|
||||
<ClInclude Include="$(OpenSSH-Src-Path)\contrib\win32\win32compat\inc\poll.h">
|
||||
<Filter>inc</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="$(OpenSSH-Src-Path)\contrib\win32\win32compat\inc\sys\wait.h">
|
||||
<Filter>inc\sys</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Filter Include="inc">
|
||||
|
@ -67,3 +67,8 @@ typedef int sigset_t;
|
||||
#define sigaddset(set, sig) ( (*(set)) |= (0x80000000 >> (sig)))
|
||||
#define sigismember(set, sig) ( (*(set) & (0x80000000 >> (sig)))?1:0 )
|
||||
#define sigdelset(set, sig) ( (*(set)) &= (~( 0x80000000 >> (sig)) ) )
|
||||
|
||||
|
||||
typedef unsigned short _mode_t;
|
||||
typedef _mode_t mode_t;
|
||||
typedef unsigned long pid_t;
|
||||
|
10
contrib/win32/win32compat/inc/sys/wait.h
Normal file
10
contrib/win32/win32compat/inc/sys/wait.h
Normal file
@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
#include "..\w32posix.h"
|
||||
|
||||
#define _W_INT(w) (*(int*)&(w)) /* convert union wait to int */
|
||||
#define WIFEXITED(w) (!((_W_INT(w)) & 0377))
|
||||
#define WIFSTOPPED(w) ((_W_INT(w)) & 0100)
|
||||
#define WIFSIGNALED(w) (!WIFEXITED(w) && !WIFSTOPPED(w))
|
||||
#define WEXITSTATUS(w) (int)(WIFEXITED(w) ? ((_W_INT(w) >> 8) & 0377) : -1)
|
||||
#define WTERMSIG(w) (int)(WIFSIGNALED(w) ? (_W_INT(w) & 0177) : -1)
|
||||
pid_t waitpid(pid_t pid, int *status, int options);
|
@ -138,5 +138,3 @@ struct iovec
|
||||
size_t iov_len;
|
||||
};
|
||||
|
||||
typedef unsigned short _mode_t;
|
||||
typedef _mode_t mode_t;
|
||||
|
@ -1,32 +0,0 @@
|
||||
#ifndef COMPAT_TYPES_H
|
||||
#define COMPAT_TYPES_H 1
|
||||
|
||||
|
||||
/* Compatibility header to allow code that uses these types to compile on Win32 */
|
||||
/* device code */
|
||||
|
||||
#if defined(__MINGW32__)
|
||||
|
||||
typedef unsigned short _mode_t;
|
||||
typedef _mode_t mode_t;
|
||||
|
||||
//typedef long time_t;
|
||||
typedef long long __time64_t;
|
||||
typedef long long off64_t;
|
||||
|
||||
/* On Win32 group and other permissions are the same as user permissions, sort of */
|
||||
/*
|
||||
FIXME: GFPZR: In newer GCC versions these seems to be defined.
|
||||
*/
|
||||
/*
|
||||
#ifndef S_IXGRP
|
||||
#define S_IXGRP S_IXUSR
|
||||
#endif
|
||||
|
||||
#ifndef S_IXOTH
|
||||
#define S_IXOTH S_IXUSR
|
||||
#endif
|
||||
*/
|
||||
#endif
|
||||
|
||||
#endif
|
@ -1,7 +0,0 @@
|
||||
#ifndef COMPAT_WAIT_H
|
||||
#define COMPAT_WAIT_H 1
|
||||
|
||||
|
||||
/* Compatibility header to avoid lots of #ifdef _WIN32's in includes.h */
|
||||
|
||||
#endif
|
@ -1,7 +1,13 @@
|
||||
#include <Windows.h>
|
||||
#include "inc\defs.h"
|
||||
|
||||
int usleep(unsigned int useconds)
|
||||
{
|
||||
Sleep(useconds / 1000);
|
||||
return 1;
|
||||
}
|
||||
|
||||
pid_t waitpid(pid_t pid, int *status, int options) {
|
||||
/* TODO - implement this*/
|
||||
return 0;
|
||||
}
|
@ -24,8 +24,6 @@
|
||||
|
||||
#include "includes.h"
|
||||
|
||||
#ifndef WIN32_FIXME
|
||||
|
||||
#ifndef HAVE_WAITPID
|
||||
#include <errno.h>
|
||||
#include <sys/wait.h>
|
||||
@ -53,5 +51,3 @@ waitpid(int pid, int *stat_loc, int options)
|
||||
}
|
||||
|
||||
#endif /* !HAVE_WAITPID */
|
||||
|
||||
#endif /* WIN32_FIXME */
|
||||
|
Loading…
x
Reference in New Issue
Block a user