Guardian Native C Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)
ctime_r(3) Guardian Native C Library Calls Reference Manual
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 and J-series native Guardian processes: $SYSTEM.ZDLLnnn.ZCREDLL
32-bit H-series and J-series OSS processes that do not use Standard POSIX Threads:
/G/system/zdllnnn/zcredll
64-bit H-series and J-series OSS processes that do not use Standard POSIX Threads:
/G/system/zdllnnn/ycredll
H-series and J-series OSS processes that use the Standard POSIX Threads library:
/G/system/zdllnnn/zsptdll
SYNOPSIS
#include <time.h> | #include <spthread.h>
/* time.h is required for H-series and J-series processes that do not use */
/* the Standard POSIX Threads library */
/* spthread.h is required for G-series native OSS processes, and for H-series */
/* and J-series OSS processes that use the Standard POSIX Threads library */
char *ctime_r(
const time_t *clock,
char *buf);
PARAMETERS
clock Points to a variable that specifies 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 specifies local time in the following 26-byte format:
Sun Sep 16 01:03:52 1973\n\0
This format contains 5 fields and is terminated by a newline and a 0 (zero) byte.
Local time-zone information is set as though the tzset( ) function were called.
NOTES
On systems running H06.21 or later H-series RVUs or J06.10 or later J-series RVUs, you can use
either the POSIX User Thread Model library or the Standard POSIX Threads library for threaded
applications.
If you are NOT using the Standard POSIX Threads library (this is not a threaded application or
you are using the POSIX User Thread Model library), you must:
• Include the time.h file
To use the Standard POSIX Threads library, you must:
• Include the spthread.h file
• Link your application to the Standard POSIX Threads library:
/G/system/sysnn/zsptsrl (G-series)
or
1−152 Hewlett-Packard Company 527192-018