chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
[PATCH] klibc: update to version 0.198
[elogind.git]
/
klibc
/
klibc
/
sleep.c
1
/*
2
* sleep.c
3
*/
4
5
#include <errno.h>
6
#include <time.h>
7
8
unsigned int sleep(unsigned int seconds)
9
{
10
struct timespec ts;
11
12
ts.tv_sec = seconds;
13
ts.tv_nsec = 0;
14
if ( !nanosleep(&ts,&ts) )
15
return 0;
16
else if ( errno == EINTR )
17
return ts.tv_sec;
18
else
19
return -1;
20
}