projects
/
musl
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
f444e76ea7107e5ad1d15d4d134e292364da7859
[musl]
/
timegm.c
1
#define _GNU_SOURCE
2
#include "time_impl.h"
3
#include <errno.h>
4
5
extern const char __utc[];
6
7
time_t timegm(struct tm *tm)
8
{
9
struct tm new;
10
long long t = __tm_to_secs(tm);
11
if (__secs_to_tm(t, &new) < 0) {
12
errno = EOVERFLOW;
13
return -1;
14
}
15
*tm = new;
16
tm->tm_isdst = 0;
17
tm->__tm_gmtoff = 0;
18
tm->__tm_zone = __utc;
19
return t;
20
}