1288143Sdelphij/*	$File: gmtime_r.c,v 1.2 2015/07/11 14:41:37 christos Exp $	*/
2284234Sdelphij
3284234Sdelphij#include "file.h"
4284234Sdelphij#ifndef	lint
5288143SdelphijFILE_RCSID("@(#)$File: gmtime_r.c,v 1.2 2015/07/11 14:41:37 christos Exp $")
6284234Sdelphij#endif	/* lint */
7284234Sdelphij#include <time.h>
8284234Sdelphij#include <string.h>
9284234Sdelphij
10284234Sdelphij/* asctime_r is not thread-safe anyway */
11284234Sdelphijstruct tm *
12288143Sdelphijgmtime_r(const time_t *t, struct tm *tm)
13284234Sdelphij{
14284234Sdelphij	struct tm *tmp = gmtime(t);
15284234Sdelphij	if (tmp == NULL)
16284234Sdelphij		return NULL;
17284234Sdelphij	memcpy(tm, tmp, sizeof(*tm));
18284234Sdelphij	return tmp;
19284234Sdelphij}
20