mirror of
https://github.com/PowerShell/Win32-OpenSSH.git
synced 2025-07-19 20:15:01 +02:00
Add usleep call for visual studio
usleep isn't part of standard windows, so we add a version of it based on Sleep();
This commit is contained in:
parent
2454a18404
commit
58d15ecb9a
@ -24,6 +24,7 @@
|
|||||||
#ifdef HAVE_SYS_TIME_H
|
#ifdef HAVE_SYS_TIME_H
|
||||||
# include <sys/time.h>
|
# include <sys/time.h>
|
||||||
#endif
|
#endif
|
||||||
|
#include <sys/utime.h>
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
@ -105,6 +106,8 @@ const char *strerror(int e)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef HAVE_UTIMES
|
#ifndef HAVE_UTIMES
|
||||||
|
|
||||||
|
|
||||||
int utimes(char *filename, struct timeval *tvp)
|
int utimes(char *filename, struct timeval *tvp)
|
||||||
{
|
{
|
||||||
struct utimbuf ub;
|
struct utimbuf ub;
|
||||||
@ -176,7 +179,16 @@ 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
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifndef HAVE_TCGETPGRP
|
#ifndef HAVE_TCGETPGRP
|
||||||
pid_t
|
pid_t
|
||||||
|
Loading…
x
Reference in New Issue
Block a user