diff options
Diffstat (limited to 'newlib/libc/posix/usleep.c')
-rw-r--r-- | newlib/libc/posix/usleep.c | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/newlib/libc/posix/usleep.c b/newlib/libc/posix/usleep.c deleted file mode 100644 index 9322b6551..000000000 --- a/newlib/libc/posix/usleep.c +++ /dev/null @@ -1,22 +0,0 @@ -/* libc/posix/usleep.c - usleep function */ - -/* Written 2002 by Jeff Johnston */ - -#ifdef HAVE_NANOSLEEP - -#include <errno.h> -#include <time.h> -#include <unistd.h> - -int usleep(useconds_t useconds) -{ - struct timespec ts; - - ts.tv_sec = (long int)useconds / 1000000; - ts.tv_nsec = ((long int)useconds % 1000000) * 1000; - if (!nanosleep(&ts,&ts)) return 0; - if (errno == EINTR) return ts.tv_sec; - return -1; -} - -#endif |