zephyr/lib/libc/common/source/time/localtime_r_utc.c
Keith Packard 7f412924d3 libc/common: Define _POSIX_C_SOURCE to gain access to POSIX functions
ctime.c and localtime_r_utc.c may use POSIX-only functions; to ensure those
are visible from a POSIX-conforming C library, define _POSIX_C_SOURCE in
these source files.

Signed-off-by: Keith Packard <keithp@keithp.com>
2024-09-16 20:17:35 +02:00

20 lines
331 B
C

/*
* Copyright (c) 2024 Meta Platforms
*
* SPDX-License-Identifier: Apache-2.0
*/
#undef _POSIX_C_SOURCE
#define _POSIX_C_SOURCE 200809L
#include <time.h>
struct tm *localtime_r(const time_t *timer, struct tm *result)
{
return gmtime_r(timer, result);
}
struct tm *localtime(const time_t *timer)
{
return gmtime(timer);
}