repo.or.cz
/
minix.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
libc, libutil: remove compat hacks
[minix.git]
/
lib
/
libc
/
sys-minix
/
gettimeofday.c
blob
352c596124bee49e31d85b3e5286e6ca960d29f2
1
/*
2
gettimeofday.c
3
*/
4
5
#include <sys/cdefs.h>
6
#include
"namespace.h"
7
#include <lib.h>
8
9
#include <sys/time.h>
10
11
#ifdef __weak_alias
12
__weak_alias
(
gettimeofday
,
_gettimeofday
)
13
#endif
14
15
int
gettimeofday
(
struct
timeval
*
__restrict tp
,
void
*
__restrict tzp
)
16
{
17
message m
;
18
19
if
(
_syscall
(
PM_PROC_NR
,
GETTIMEOFDAY
, &
m
) <
0
)
20
return
-
1
;
21
22
tp
->
tv_sec
=
m
.
m2_l1
;
23
tp
->
tv_usec
=
m
.
m2_l2
;
24
25
return
0
;
26
}
27