usleep and getdtablesize() updates

This commit is contained in:
manojampalam 2016-03-21 21:10:14 -07:00
parent ae3705d53b
commit f04dc7c355
10 changed files with 19 additions and 25 deletions

View File

@ -1691,11 +1691,8 @@ typedef long ssize_t;
#endif
#endif
#ifndef _WIN32
#define HAVE_POLL 1
#endif
#define HAVE_STRTOULL 1
#undef HAVE_USLEEP
#define HAVE_USLEEP 1
#if defined ( WIN32 )
#define __func__ __FUNCTION__
@ -1732,3 +1729,5 @@ typedef long ssize_t;
// works remotely over SSH like they operate in a local machine
//#define WIN32_PRAGMA_REMCON
#define HAVE_MBLEN 1

View File

@ -146,6 +146,7 @@
<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\termio.c" />
<ClCompile Include="$(OpenSSH-Src-Path)\contrib\win32\win32compat\misc.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="$(OpenSSH-Src-Path)\contrib\win32\win32compat\w32fd.h" />

View File

@ -6,6 +6,7 @@
<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\termio.c" />
<ClCompile Include="$(OpenSSH-Src-Path)\contrib\win32\win32compat\misc.c" />
</ItemGroup>
<ItemGroup>
<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">
<Filter>inc</Filter>
</ClInclude>
<ClInclude Include="..\win32compat\inc\poll.h">
<ClInclude Include="$(OpenSSH-Src-Path)\contrib\win32\win32compat\inc\poll.h">
<Filter>inc</Filter>
</ClInclude>
</ItemGroup>

View File

@ -4,4 +4,4 @@
/* 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);

View File

@ -1,3 +1,4 @@
#include <sys\utime.h>
#define utimbuf _utimbuf
#define utimbuf _utimbuf
int usleep(unsigned int);

View File

@ -33,6 +33,8 @@
#define alarm w32_alarm
#define lseek w32_lseek
#define getdtablesize() MAX_FDS
/* Compatibility header to avoid lots of #ifdefs in includes.h on Win32 */
#include <conio.h>

View File

@ -0,0 +1,7 @@
#include <Windows.h>
int usleep(unsigned int useconds)
{
Sleep(useconds / 1000);
return 1;
}

View File

@ -51,11 +51,6 @@
# define OPEN_MAX 256
#endif
#ifdef WIN32_FIXME
#define getdtablesize() FD_SETSIZE
#endif
#if 0
__unused static const char rcsid[] = "$Sudo: closefrom.c,v 1.11 2006/08/17 15:26:54 millert Exp $";
#endif /* lint */

View File

@ -167,7 +167,7 @@ int nanosleep(const struct timespec *req, struct timespec *rem)
return(rc);
}
#endif
#ifndef WIN32_FIXME
#if !defined(HAVE_USLEEP)
int usleep(unsigned int useconds)
{
@ -178,16 +178,6 @@ int usleep(unsigned int useconds)
return nanosleep(&ts, NULL);
}
#endif
#else
#if !defined(HAVE_USLEEP)
int usleep(unsigned int useconds)
{
Sleep(useconds/1000);
return 1;
}
#endif
#endif
#ifndef HAVE_TCGETPGRP
pid_t

View File

@ -227,12 +227,10 @@ unsigned long long strtoull(const char *, char **, int);
long long strtonum(const char *, long long, long long, const char **);
#endif
#ifndef WIN32_FIXME
/* multibyte character support */
#ifndef HAVE_MBLEN
# define mblen(x, y) (1)
#endif
#endif
#if !defined(HAVE_VASPRINTF) || !defined(HAVE_VSNPRINTF)
# include <stdarg.h>