repo.or.cz
/
newlib-cygwin.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Cygwin: access: Fix X_OK behaviour for backup operators and admins
[newlib-cygwin.git]
/
newlib
/
libc
/
machine
/
spu
/
sleep.c
blob
f3aa97954a09f1fe473a1ad03c1bc6642bb85398
1
/* Copied from libc/posix/sleep.c, removed the check for HAVE_NANOSLEEP */
2
3
/* Written 2000 by Werner Almesberger */
4
5
#include <errno.h>
6
#include <time.h>
7
#include <unistd.h>
8
9
unsigned
sleep
(
unsigned
seconds
)
10
{
11
struct
timespec ts
;
12
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
;
18
}