From 4abab5ad6c8465a7528ccdd5f49367da05f78bbd Mon Sep 17 00:00:00 2001 From: Vladimir Azarov Date: Tue, 1 Oct 2024 15:47:05 +0200 Subject: Initial version --- src/time/gmtime_r.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/time/gmtime_r.c (limited to 'src/time/gmtime_r.c') diff --git a/src/time/gmtime_r.c b/src/time/gmtime_r.c new file mode 100644 index 0000000..22aec2c --- /dev/null +++ b/src/time/gmtime_r.c @@ -0,0 +1,16 @@ +#include "time_impl.h" +#include + +struct tm *__gmtime_r(const time_t *restrict t, struct tm *restrict tm) +{ + if (__secs_to_tm(*t, tm) < 0) { + errno = EOVERFLOW; + return 0; + } + tm->tm_isdst = 0; + tm->__tm_gmtoff = 0; + tm->__tm_zone = __utc; + return tm; +} + +weak_alias(__gmtime_r, gmtime_r); -- cgit v1.2.3