repo.or.cz
/
wrf-fire-matlab.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Merge branch 'fixf'
[wrf-fire-matlab.git]
/
femwind
/
fortran
/
msleep.c
blob
ab58bc744fd540ba320680181a31dbbc4d38295f
1
#include <time.h>
2
#include <errno.h>
3
4
int
msleep
(
long
msec
) {
5
/* wait msec miliseconds */
6
struct
timespec ts
;
7
int
res
;
8
9
if
(
msec
<
0
) {
10
errno
=
EINVAL
;
11
return
-
1
;
12
}
13
14
ts
.
tv_sec
=
msec
/
1000
;
15
ts
.
tv_nsec
= (
msec
%
1000
) *
1000000
;
16
17
do
{
18
res
=
nanosleep
(&
ts
, &
ts
);
19
}
while
(
res
&&
errno
==
EINTR
);
20
21
return
res
;
22
}
23