Cygwin: access: Fix X_OK behaviour for backup operators and admins
[newlib-cygwin.git] / newlib / libc / machine / spu / sleep.c
blobf3aa97954a09f1fe473a1ad03c1bc6642bb85398
1 /* Copied from libc/posix/sleep.c, removed the check for HAVE_NANOSLEEP */
3 /* Written 2000 by Werner Almesberger */
5 #include <errno.h>
6 #include <time.h>
7 #include <unistd.h>
9 unsigned sleep(unsigned seconds)
11 struct timespec ts;
13 ts.tv_sec = seconds;
14 ts.tv_nsec = 0;
15 if (!nanosleep(&ts,&ts)) return 0;
16 if (errno == EINTR) return ts.tv_sec;
17 return -1;