diff --git a/contrib/win32/openssh/config.h.vs b/contrib/win32/openssh/config.h.vs index 81afa1b..2424414 100644 --- a/contrib/win32/openssh/config.h.vs +++ b/contrib/win32/openssh/config.h.vs @@ -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; diff --git a/contrib/win32/openssh/win32iocompat.vcxproj b/contrib/win32/openssh/win32iocompat.vcxproj index 570387f..af3e97c 100644 --- a/contrib/win32/openssh/win32iocompat.vcxproj +++ b/contrib/win32/openssh/win32iocompat.vcxproj @@ -157,6 +157,7 @@ + diff --git a/contrib/win32/openssh/win32iocompat.vcxproj.filters b/contrib/win32/openssh/win32iocompat.vcxproj.filters index 31b99aa..2da4e4f 100644 --- a/contrib/win32/openssh/win32iocompat.vcxproj.filters +++ b/contrib/win32/openssh/win32iocompat.vcxproj.filters @@ -40,6 +40,9 @@ inc + + inc\sys + diff --git a/contrib/win32/win32compat/inc/defs.h b/contrib/win32/win32compat/inc/defs.h index 8287837..38c9cb5 100644 --- a/contrib/win32/win32compat/inc/defs.h +++ b/contrib/win32/win32compat/inc/defs.h @@ -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; diff --git a/contrib/win32/win32compat/inc/sys/wait.h b/contrib/win32/win32compat/inc/sys/wait.h new file mode 100644 index 0000000..e5100eb --- /dev/null +++ b/contrib/win32/win32compat/inc/sys/wait.h @@ -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); \ No newline at end of file diff --git a/contrib/win32/win32compat/inc/w32posix.h b/contrib/win32/win32compat/inc/w32posix.h index 4b8ce81..e882610 100644 --- a/contrib/win32/win32compat/inc/w32posix.h +++ b/contrib/win32/win32compat/inc/w32posix.h @@ -138,5 +138,3 @@ struct iovec size_t iov_len; }; -typedef unsigned short _mode_t; -typedef _mode_t mode_t; diff --git a/contrib/win32/win32compat/includes/sys/compat-types.h b/contrib/win32/win32compat/includes/sys/compat-types.h deleted file mode 100644 index b8c0d73..0000000 --- a/contrib/win32/win32compat/includes/sys/compat-types.h +++ /dev/null @@ -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 diff --git a/contrib/win32/win32compat/includes/sys/wait.h b/contrib/win32/win32compat/includes/sys/wait.h deleted file mode 100644 index ea8ec75..0000000 --- a/contrib/win32/win32compat/includes/sys/wait.h +++ /dev/null @@ -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 diff --git a/contrib/win32/win32compat/misc.c b/contrib/win32/win32compat/misc.c index 3011f13..c5fd552 100644 --- a/contrib/win32/win32compat/misc.c +++ b/contrib/win32/win32compat/misc.c @@ -1,7 +1,13 @@ #include +#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; } \ No newline at end of file diff --git a/openbsd-compat/bsd-waitpid.c b/openbsd-compat/bsd-waitpid.c index 2fae85e..40e6ffa 100644 --- a/openbsd-compat/bsd-waitpid.c +++ b/openbsd-compat/bsd-waitpid.c @@ -24,8 +24,6 @@ #include "includes.h" -#ifndef WIN32_FIXME - #ifndef HAVE_WAITPID #include #include @@ -53,5 +51,3 @@ waitpid(int pid, int *stat_loc, int options) } #endif /* !HAVE_WAITPID */ - -#endif /* WIN32_FIXME */