Guardian Native C Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)
asctime_r(3) Guardian Native C Library Calls Reference Manual
NAME
asctime_r - Converts broken-down time 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 *asctime_r(
const struct tm *timeptr,
char *buf);
PARAMETERS
timeptr Points to a type tm structure that contains the broken-down time.
buf Points to the buffer where the converted time is stored. This buffer must be at
least 26 bytes long.
DESCRIPTION
The asctime_r() function is the reentrant version of the asctime() function.
The asctime_r(), ctime_r(), difftime(), gmtime( ), gmtime_r(), localtime(), localtime_r(),
mktime(), and tzset() functions are used to convert time units to strings, to store converted time
units for subsequent processing, and to convert stored time information to other time units. Time
information used in these functions is stored in a type tm structure, which is defined in the time.h
header file.
The asctime_r() function converts broken-down time information to a date and time string with
the following 26-byte format:
Sun Sep 16 01:03:52 1973\n\0
This format contains five fields and is terminated by a newline character and a 0 (zero) byte.
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
1−20 Hewlett-Packard Company 527192-018