Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)
OSS Library Calls (t - v) tmpnam_r(3)
NAME
tmpnam_r - Constructs the name for a temporary file (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 <stdio.h> | #include <spthread.h>
/* stdio.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 *tmpnam_r(
char *buf);
PARAMETERS
buf Specifies the address of an array of at least the number of bytes specified by
L_tmpnam, a constant defined in the stdio.h header file.
DESCRIPTION
The tmpnam_r( ) function is the reentrant version of the tmpnam( ) function.
The tmpnam_r( ) function constructs the name for a temporary file.
The tmpnam_r( ) function generates a different filename each time it is called. If a single pro-
cess calls it more than TMP_MAX times, it starts reusing previously used names.
H-series and J-series native OSS processes
The tmpnam_r( ) function generates a filename using the pathname defined as P_tmpdir in the
stdio.h header file.
Files created using this function reside in a directory intended for temporary use, and their names
are unique. It is the user’s responsibility to use the unlink( ) function to remove the file when it is
no longer needed.
Between the time a filename is created and the file is opened, it is possible for some other process
to create a file with the same name. This duplication should not happen if that other process uses
these functions, and if the filenames are chosen to make duplication by other means unlikely.
G-series, H-series, and J-series native Guardian processes
The tmpnam_r( ) function generates a filename for a temporary file. The filename differs from
all filenames in the default volume and subvolume; consequently, you can use this name to create
a new file.
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:
527187-017 Hewlett-Packard Company 7−53