repo.or.cz
/
musl.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
fix return value of gethostnbyname[2]_r on result not found
[musl.git]
/
compat
/
time32
/
time32.c
blob
4b8fac1c291eb941dd531d0f450656a6cf1cb82e
1
#include
"time32.h"
2
#include <time.h>
3
#include <errno.h>
4
#include <stdint.h>
5
6
time32_t
__time32
(
time32_t
*
p
)
7
{
8
time_t
t
=
time
(
0
);
9
if
(
t
<
INT32_MIN
||
t
>
INT32_MAX
) {
10
errno
=
EOVERFLOW
;
11
return
-
1
;
12
}
13
if
(
p
) *
p
=
t
;
14
return
t
;
15
}