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
|
||||
# include <sys/time.h>
|
||||
#endif
|
||||
#include <sys/utime.h>
|
||||
|
||||
#include <string.h>
|
||||
#include <signal.h>
|
||||
|
@ -105,6 +106,8 @@ const char *strerror(int e)
|
|||
#endif
|
||||
|
||||
#ifndef HAVE_UTIMES
|
||||
|
||||
|
||||
int utimes(char *filename, struct timeval *tvp)
|
||||
{
|
||||
struct utimbuf ub;
|
||||
|
@ -176,7 +179,16 @@ 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
|
||||
|
|
Loading…
Reference in New Issue