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

tmpnam_r(2) OSS System Calls Reference Manual
NAME
tmpnam_r - Constructs the name for a temporary le (reentrant)
LIBRARY
G-series native OSS processes: /G/system/sysnn/zsptsrl
H-series OSS processes: /G/system/zdllnnn/zsptdll
SYNOPSIS
[#include <stdio.h>]
#include <spthread.h>
char *tmpnam_r (
char *buf
);
PARAMETERS
buf Species the address of an array of at least the number of bytes specied by
L_tmpnam, a constant dened in the stdio.h header le.
DESCRIPTION
The tmpnam_r( ) function is the reentrant version of the tmpnam() function.
The tmpnam_r( ) function generates a lename using the pathname dened as P_tmpdir in the
stdio.h header le.
Files created using this function reside in a directory intended for temporary use, and their names
are unique. It is the users responsibility to use the unlink() function to remove the le when it is
no longer needed.
Between the time a lename is created and the le is opened, it is possible for some other process
to create a le with the same name. This should not happen if that other process uses these func-
tions, and if the lenames are chosen to make duplication by other means unlikely.
The tmpnam_r( ) function generates a different lename each time it is called. If it is called
more than TMP_MAX times by a single process, it starts reusing previously used names.
RETURN VALUES
If the buf parameter is not a null pointer, it is assumed to be the address of an array of at least the
number of bytes specied by L_tmpnam. L_tmpnam is a constant dened in the stdio.h header
le. The tmpnam_r( ) function places its results into that array and returns the value of the buf
parameter.
If buf is a null pointer, the function returns NULL. This behavior differs from that of the
tmpnam( ) function.
RELATED INFORMATION
Functions: tmpnam(3), tmpnam_oss(3).
STANDARDS CONFORMANCE
This function is an extension to the UNIX98 specication. Interfaces documented on this refer-
ence page conform to the following industry standards:
IEEE Std 1003.1c-1995, POSIX System Application Program Interface
The use of the header le spthread.h is an HP exception to the POSIX standard.
872 Hewlett-Packard Company 527186-005