Open System Services System Calls Reference Manual (G06.28+)

System Functions (a - d) ctime_r(2)
NAME
ctime_r - Converts time since the Epoch into a date and time string (reentrant)
LIBRARY
G-series native OSS processes: /G/system/sysnn/zsptsrl
H-series OSS processes: /G/system/zdllnnn/zsptdll
SYNOPSIS
[#include <time.h>]
#include <spthread.h>
char *ctime_r (
const time_t *clock,
char *buf );
PARAMETERS
clock Points to a variable that species a time value in seconds.
buf Points to the buffer where the converted time is stored. This buffer must be at
least 26 bytes long.
DESCRIPTION
The ctime_r() function is the reentrant version of the ctime() function.
The ctime_r() function converts the time in seconds since the Epoch, pointed to by the clock
parameter, to a character string. The Epoch is taken as 00:00:00 UTC January 1, 1970. The
character string species local time in the following 26-byte format:
Sun Sep 16 01:03:52 1973\n\0
This format contains 5 elds and is terminated by a newline and a 0 (zero) byte.
Local time-zone information is set as though the tzset() function were called.
RETURN VALUES
Upon successful completion, the ctime_r() function puts the string into the array pointed to by
buf and returns buf. On error, this function returns a null pointer.
ERRORS
No error values are returned. This function does not set the errno variable.
RELATED INFORMATION
Functions: asctime(3), asctime_r(2), ctime(3), ctime_r(2), difftime(3), getenv(3), gmtime(3),
gmtime_r(2), localtime(3), localtime(2), mktime(3), strftime(3), time(3), tzset(3), utime(3).
STANDARDS CONFORMANCE
Interfaces documented on this reference page conform to the following industry standards:
IEEE Std 1003.1c-1996, POSIX System Application Program Interface.
The use of the header le spthread.h is an HP exception to the POSIX standard.
527186-005 Hewlett-Packard Company 141