gmtime_r() has been in the minimal libc for years, however it was not added to expcetions due to an overlook. In order to do this however, it has to be moved first to the common libc area, so that it's available to any libc that may not implement it. Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
18 lines
391 B
C
18 lines
391 B
C
/*
|
|
* Copyright (c) 2019 Peter Bigot Consulting, LLC
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
#include <time.h>
|
|
#include <zephyr/sys/libc-hooks.h>
|
|
|
|
#ifdef CONFIG_MINIMAL_LIBC_NON_REENTRANT_FUNCTIONS
|
|
static Z_LIBC_DATA struct tm gmtime_result;
|
|
|
|
struct tm *gmtime(const time_t *timep)
|
|
{
|
|
return gmtime_r(timep, &gmtime_result);
|
|
}
|
|
#endif /* CONFIG_MINIMAL_LIBC_NON_REENTRANT_FUNCTIONS */
|