56#define CLOCKS_PER_SEC ((clock_t)CPU_TIMER_HZ)
62#define TIMER_ABSTIME 1
101#if SCHEDULER_ACCOUNTING == true
104 return platform_monotonic_time_read();
122 TimeoutArgument timeout);
132__cheriot_libcall time_t
time(time_t *tloc);
198struct tm *__cheriot_libcall
gmtime_r(
const time_t *__restrict timer,
199 struct tm *__restrict result);
207static inline struct tm *
gmtime(
const time_t *timer)
209 static struct tm result;
A time value with up to nanosecond precision.
uint32_t tv_nsec
Nanoseconds.
Structure representing a date in the Gregorian calendar.
int tm_mon
Month of the year, in the range 0–11.
int tm_year
Year, as an offset from 1900 (so, for example, 2023 is 123).
int tm_hour
Hours, in the range 0–23.
int tm_sec
Seconds, in the range 0–60 (to account for leap seconds).
int tm_isdst
Daylight savings flag.
int tm_yday
Day of the year, in the range 0–365 (0–364 if this is not a leap year).
int tm_mday
Day of the month, in the range 1–31, or less if the month has fewer than 31 days.
int tm_min
Minutes, in the range 0–59.
int tm_wday
Day of the week, in the range 0–6.
Functions and types used for thread management.
uint64_t thread_elapsed_cycles_current(void)
Returns the number of cycles accounted to the current thread.
__cheriot_libcall int clock_gettime(clockid_t clockID, struct timespec *outTime)
Retrieve the time from the specified clock as a timespec.
struct tm *__cheriot_libcall gmtime_r(const time_t *__restrict timer, struct tm *__restrict result)
C standard function to calculate a human-readable UTC date and time in a struct tm from a UNIX timest...
__cheriot_compartment("wall_clock") int clock_update_wall_clock(TimeoutArgument timeout)
Update the wall-clock time from available time sources.
time_t __cheriot_libcall timegm(struct tm *time)
Convert a struct tm to a time_t.
static struct tm * gmtime(const time_t *timer)
C standard function to calculate a human-readable UTC date and time in a struct tm from a UNIX timest...
uint64_t clock_t
Type for holding time.
__clockid_t
ID for a clock. Only monotonic and 'realtime' (wall clock) are supported.
@ CLOCK_MONOTONIC
The monotonic clock.
@ CLOCK_REALTIME
The wall-clock time.
@ CLOCK_THREAD_CPUTIME_ID
CPU time consumed by the current thread, since boot time.
@ CLOCK_PROCESS_CPUTIME_ID
CPU time consumed by the current 'process'.
__cheriot_libcall time_t time(time_t *tloc)
POSIX-compatible time() implementation.
enum __clockid_t clockid_t
ID for a clock. Only monotonic and 'realtime' (wall clock) are supported.
static clock_t clock(void)
Returns the amount of CPU time (in units defined by CLOCKS_PER_SEC) that are accounted to the current...