1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-28 01:58:17 +03:00

libreplace: Add usleep implementation.

This commit is contained in:
Jelmer Vernooij 2012-03-24 21:17:56 +01:00
parent c9fb33697d
commit 49eca290d3
2 changed files with 20 additions and 0 deletions

View File

@ -890,3 +890,17 @@ int rep_getpeereid(int s, uid_t *uid, gid_t *gid)
#endif
}
#endif
#ifndef HAVE_USLEEP
int rep_usleep(useconds_t sec)
{
struct timeval tval;
/*
* Fake it with select...
*/
tval.tv_sec = 0;
tval.tv_usec = usecs/1000;
select(0,NULL,NULL,NULL,&tval);
return 0;
}
#endif /* HAVE_USLEEP */

View File

@ -835,4 +835,10 @@ char *rep_getpass(const char *prompt);
int rep_getpeereid(int s, uid_t *uid, gid_t *gid);
#endif
#ifndef HAVE_USLEEP
#define usleep rep_usleep
typedef long useconds_t;
int usleep(useconds_t);
#endif
#endif /* _LIBREPLACE_REPLACE_H */