mirror of
https://github.com/espressif/esp-idf.git
synced 2026-08-18 06:35:35 +03:00
Both newlib and picolibc headers in toolchain 16.1 declare timespec_get() but the archives do not define it. Provide the missing C11 implementation through esp_libc, mapping TIME_UTC to clock_gettime(CLOCK_REALTIME). Closes https://github.com/espressif/esp-idf/issues/18889
36 lines
643 B
C
36 lines
643 B
C
/*
|
|
* SPDX-FileCopyrightText: 2018-2026 Espressif Systems (Shanghai) CO LTD
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include_next <time.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#define _POSIX_TIMERS 1
|
|
#ifndef CLOCK_MONOTONIC
|
|
#define CLOCK_MONOTONIC (clockid_t)4
|
|
#endif
|
|
#ifndef CLOCK_BOOTTIME
|
|
#define CLOCK_BOOTTIME (clockid_t)4
|
|
#endif
|
|
|
|
#ifndef TIME_UTC
|
|
#define TIME_UTC 1
|
|
#endif
|
|
|
|
int clock_settime(clockid_t clock_id, const struct timespec *tp);
|
|
int clock_gettime(clockid_t clock_id, struct timespec *tp);
|
|
int clock_getres(clockid_t clock_id, struct timespec *res);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|