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
select: overhaul for time64
[musl.git]
/
src
/
time
/
timegm.c
blob
4e5907d7f56027f960c088014d935fb9c3682ca1
1
#define _GNU_SOURCE
2
#include
"time_impl.h"
3
#include <errno.h>
4
5
time_t
timegm
(
struct
tm
*
tm
)
6
{
7
struct
tm
new
;
8
long long
t
=
__tm_to_secs
(
tm
);
9
if
(
__secs_to_tm
(
t
, &
new
) <
0
) {
10
errno
=
EOVERFLOW
;
11
return
-
1
;
12
}
13
*
tm
=
new
;
14
tm
->
tm_isdst
=
0
;
15
tm
->
__tm_gmtoff
=
0
;
16
tm
->
__tm_zone
=
__utc
;
17
return
t
;
18
}