posix-next API 0.1.0
Out-of-tree Zephyr POSIX module
Loading...
Searching...
No Matches
POSIX_C_LANG_SUPPORT_R

POSIX C Language Support (reentrant) option group. More...

Functions

char * asctime_r (const struct tm *ZRESTRICT tm, char *ZRESTRICT buf)
 Convert broken-down time to a string (thread-safe version of asctime()).
 
char * ctime_r (const time_t *clock, char *buf)
 Convert a time_t to a string (thread-safe version of ctime()).
 
struct tm * gmtime_r (const time_t *ZRESTRICT timer, struct tm *ZRESTRICT result)
 Convert a time_t to UTC broken-down time (thread-safe version of gmtime()).
 
struct tm * localtime_r (const time_t *ZRESTRICT timer, struct tm *ZRESTRICT result)
 Convert a time_t to local broken-down time (thread-safe version of localtime()).
 

Detailed Description

POSIX C Language Support (reentrant) option group.

Function Documentation

◆ asctime_r()

char * asctime_r ( const struct tm *ZRESTRICT  tm,
char *ZRESTRICT  buf 
)

Convert broken-down time to a string (thread-safe version of asctime()).

Parameters
tmBroken-down time.
bufCaller-supplied buffer of at least 26 bytes.
Returns
buf on success, or NULL on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/asctime_r.html

◆ ctime_r()

char * ctime_r ( const time_t *  clock,
char *  buf 
)

Convert a time_t to a string (thread-safe version of ctime()).

Parameters
clockPointer to a time_t value.
bufCaller-supplied buffer of at least 26 bytes.
Returns
buf on success, or NULL on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/ctime_r.html

◆ gmtime_r()

struct tm * gmtime_r ( const time_t *ZRESTRICT  timer,
struct tm *ZRESTRICT  result 
)

Convert a time_t to UTC broken-down time (thread-safe version of gmtime()).

Parameters
timerPointer to the time_t value.
resultCaller-supplied storage for the result.
Returns
result on success, or NULL on failure.

◆ localtime_r()

struct tm * localtime_r ( const time_t *ZRESTRICT  timer,
struct tm *ZRESTRICT  result 
)

Convert a time_t to local broken-down time (thread-safe version of localtime()).

Parameters
timerPointer to the time_t value.
resultCaller-supplied storage for the result.
Returns
result on success, or NULL on failure.