mirror of
https://github.com/PowerShell/Win32-OpenSSH.git
synced 2025-07-23 22:15:37 +02:00
usleep and getdtablesize() updates
This commit is contained in:
parent
ae3705d53b
commit
f04dc7c355
@ -1691,11 +1691,8 @@ typedef long ssize_t;
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef _WIN32
|
|
||||||
#define HAVE_POLL 1
|
|
||||||
#endif
|
|
||||||
#define HAVE_STRTOULL 1
|
#define HAVE_STRTOULL 1
|
||||||
#undef HAVE_USLEEP
|
#define HAVE_USLEEP 1
|
||||||
|
|
||||||
#if defined ( WIN32 )
|
#if defined ( WIN32 )
|
||||||
#define __func__ __FUNCTION__
|
#define __func__ __FUNCTION__
|
||||||
@ -1732,3 +1729,5 @@ typedef long ssize_t;
|
|||||||
// works remotely over SSH like they operate in a local machine
|
// works remotely over SSH like they operate in a local machine
|
||||||
//#define WIN32_PRAGMA_REMCON
|
//#define WIN32_PRAGMA_REMCON
|
||||||
|
|
||||||
|
|
||||||
|
#define HAVE_MBLEN 1
|
||||||
|
@ -146,6 +146,7 @@
|
|||||||
<ClCompile Include="$(OpenSSH-Src-Path)\contrib\win32\win32compat\socketio.c" />
|
<ClCompile Include="$(OpenSSH-Src-Path)\contrib\win32\win32compat\socketio.c" />
|
||||||
<ClCompile Include="$(OpenSSH-Src-Path)\contrib\win32\win32compat\fileio.c" />
|
<ClCompile Include="$(OpenSSH-Src-Path)\contrib\win32\win32compat\fileio.c" />
|
||||||
<ClCompile Include="$(OpenSSH-Src-Path)\contrib\win32\win32compat\termio.c" />
|
<ClCompile Include="$(OpenSSH-Src-Path)\contrib\win32\win32compat\termio.c" />
|
||||||
|
<ClCompile Include="$(OpenSSH-Src-Path)\contrib\win32\win32compat\misc.c" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="$(OpenSSH-Src-Path)\contrib\win32\win32compat\w32fd.h" />
|
<ClInclude Include="$(OpenSSH-Src-Path)\contrib\win32\win32compat\w32fd.h" />
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
<ClCompile Include="$(OpenSSH-Src-Path)\contrib\win32\win32compat\socketio.c" />
|
<ClCompile Include="$(OpenSSH-Src-Path)\contrib\win32\win32compat\socketio.c" />
|
||||||
<ClCompile Include="$(OpenSSH-Src-Path)\contrib\win32\win32compat\fileio.c" />
|
<ClCompile Include="$(OpenSSH-Src-Path)\contrib\win32\win32compat\fileio.c" />
|
||||||
<ClCompile Include="$(OpenSSH-Src-Path)\contrib\win32\win32compat\termio.c" />
|
<ClCompile Include="$(OpenSSH-Src-Path)\contrib\win32\win32compat\termio.c" />
|
||||||
|
<ClCompile Include="$(OpenSSH-Src-Path)\contrib\win32\win32compat\misc.c" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="$(OpenSSH-Src-Path)\contrib\win32\win32compat\w32fd.h" />
|
<ClInclude Include="$(OpenSSH-Src-Path)\contrib\win32\win32compat\w32fd.h" />
|
||||||
@ -36,7 +37,7 @@
|
|||||||
<ClInclude Include="$(OpenSSH-Src-Path)\contrib\win32\win32compat\inc\w32posix.h">
|
<ClInclude Include="$(OpenSSH-Src-Path)\contrib\win32\win32compat\inc\w32posix.h">
|
||||||
<Filter>inc</Filter>
|
<Filter>inc</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="..\win32compat\inc\poll.h">
|
<ClInclude Include="$(OpenSSH-Src-Path)\contrib\win32\win32compat\inc\poll.h">
|
||||||
<Filter>inc</Filter>
|
<Filter>inc</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
@ -4,4 +4,4 @@
|
|||||||
|
|
||||||
/* created to #def out decarations in open-bsd.h (that are defined in winsock2.h) */
|
/* created to #def out decarations in open-bsd.h (that are defined in winsock2.h) */
|
||||||
|
|
||||||
int poll(struct pollfd *, nfds_t, int);
|
int poll(struct pollfd *, nfds_t, int);
|
@ -1,3 +1,4 @@
|
|||||||
#include <sys\utime.h>
|
#include <sys\utime.h>
|
||||||
|
|
||||||
#define utimbuf _utimbuf
|
#define utimbuf _utimbuf
|
||||||
|
int usleep(unsigned int);
|
@ -33,6 +33,8 @@
|
|||||||
#define alarm w32_alarm
|
#define alarm w32_alarm
|
||||||
#define lseek w32_lseek
|
#define lseek w32_lseek
|
||||||
|
|
||||||
|
#define getdtablesize() MAX_FDS
|
||||||
|
|
||||||
/* Compatibility header to avoid lots of #ifdefs in includes.h on Win32 */
|
/* Compatibility header to avoid lots of #ifdefs in includes.h on Win32 */
|
||||||
|
|
||||||
#include <conio.h>
|
#include <conio.h>
|
||||||
|
7
contrib/win32/win32compat/misc.c
Normal file
7
contrib/win32/win32compat/misc.c
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
#include <Windows.h>
|
||||||
|
|
||||||
|
int usleep(unsigned int useconds)
|
||||||
|
{
|
||||||
|
Sleep(useconds / 1000);
|
||||||
|
return 1;
|
||||||
|
}
|
@ -51,11 +51,6 @@
|
|||||||
# define OPEN_MAX 256
|
# define OPEN_MAX 256
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef WIN32_FIXME
|
|
||||||
#define getdtablesize() FD_SETSIZE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
__unused static const char rcsid[] = "$Sudo: closefrom.c,v 1.11 2006/08/17 15:26:54 millert Exp $";
|
__unused static const char rcsid[] = "$Sudo: closefrom.c,v 1.11 2006/08/17 15:26:54 millert Exp $";
|
||||||
#endif /* lint */
|
#endif /* lint */
|
||||||
|
@ -167,7 +167,7 @@ int nanosleep(const struct timespec *req, struct timespec *rem)
|
|||||||
return(rc);
|
return(rc);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#ifndef WIN32_FIXME
|
|
||||||
#if !defined(HAVE_USLEEP)
|
#if !defined(HAVE_USLEEP)
|
||||||
int usleep(unsigned int useconds)
|
int usleep(unsigned int useconds)
|
||||||
{
|
{
|
||||||
@ -178,16 +178,6 @@ int usleep(unsigned int useconds)
|
|||||||
return nanosleep(&ts, NULL);
|
return nanosleep(&ts, NULL);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#else
|
|
||||||
#if !defined(HAVE_USLEEP)
|
|
||||||
int usleep(unsigned int useconds)
|
|
||||||
{
|
|
||||||
Sleep(useconds/1000);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef HAVE_TCGETPGRP
|
#ifndef HAVE_TCGETPGRP
|
||||||
pid_t
|
pid_t
|
||||||
|
@ -227,12 +227,10 @@ unsigned long long strtoull(const char *, char **, int);
|
|||||||
long long strtonum(const char *, long long, long long, const char **);
|
long long strtonum(const char *, long long, long long, const char **);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef WIN32_FIXME
|
|
||||||
/* multibyte character support */
|
/* multibyte character support */
|
||||||
#ifndef HAVE_MBLEN
|
#ifndef HAVE_MBLEN
|
||||||
# define mblen(x, y) (1)
|
# define mblen(x, y) (1)
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined(HAVE_VASPRINTF) || !defined(HAVE_VSNPRINTF)
|
#if !defined(HAVE_VASPRINTF) || !defined(HAVE_VSNPRINTF)
|
||||||
# include <stdarg.h>
|
# include <stdarg.h>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user