From 10429269fbeb9442be4c5592b9111ccedbfefd0d Mon Sep 17 00:00:00 2001 From: Lorry Tar Creator Date: Sat, 2 Sep 2017 08:54:31 +0000 Subject: file-5.32 --- src/gmtime_r.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/gmtime_r.c (limited to 'src/gmtime_r.c') diff --git a/src/gmtime_r.c b/src/gmtime_r.c new file mode 100644 index 0000000..469ec65 --- /dev/null +++ b/src/gmtime_r.c @@ -0,0 +1,19 @@ +/* $File: gmtime_r.c,v 1.2 2015/07/11 14:41:37 christos Exp $ */ + +#include "file.h" +#ifndef lint +FILE_RCSID("@(#)$File: gmtime_r.c,v 1.2 2015/07/11 14:41:37 christos Exp $") +#endif /* lint */ +#include +#include + +/* asctime_r is not thread-safe anyway */ +struct tm * +gmtime_r(const time_t *t, struct tm *tm) +{ + struct tm *tmp = gmtime(t); + if (tmp == NULL) + return NULL; + memcpy(tm, tmp, sizeof(*tm)); + return tmp; +} -- cgit v1.2.1