Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)

OSS Library Calls (t - v) tmpnam_oss(3)
NAME
tmpnam_oss - Constructs the name for a temporary file (OSS tmpnam( ) function)
LIBRARY
G-series native Guardian processes: $SYSTEM.SYSnn.ZCRTLSRL
G-series native OSS processes: /G/system/sysnn/zcrtlsrl
H-series and J-series native Guardian processes: $SYSTEM.ZDLLnnn.ZCRTLDLL
32-bit H-series and J-series OSS processes: /G/system/zdllnnn/zcrtldll
64-bit H-series and J-series OSS processes: /G/system/zdllnnn/ycrtldll
SYNOPSIS
#include <stdio.h>
char *tmpnam(
char *s);
char *tmpnam_oss(
char *s);
PARAMETERS
s 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( ) OSS function and tmpnam_oss( ) function generate lenames for temporary
files.
These functions are identical in the OSS environment. Unless otherwise noted, this reference
page uses tmpnam( ) to refer to both the tmpnam( ) OSS function and tmpnam_oss( ) function.
The tmpnam( ) 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 should not happen if that other process uses these func-
tions, and if the filenames are chosen to make duplication by other means unlikely.
The tmpnam( ) 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.
Interoperability Variants
The C run-time library supports two variants of the tmpnam( ) function: tmpnam_oss( ) and
tmpnam_guardian( ). The variants support the unique file naming conventions and structures of
the OSS and Guardian file systems, respectively.
The header le maps calls to tmpnam( ) to the variant that matches the target compilation
environment. The target environment is set with the systype pragma.
Explicit calls to the tmpnam_oss( ) and tmpnam_guardian( ) variants in source code are only
made when the behavior of one environment is desired from the other environment.
tmpnam_oss( ) is functionally identical to the tmpnam( ) function of the OSS environment. It is
the same as setting systype oss at compile-time. systype oss is the default setting for c89
in the OSS environment.
tmpnam_guardian( ) is functionally identical to the tmpnam( ) function of the Guardian
environment. It is the same as setting systype guardian at compile-time. systype guar-
dian is the default setting for the C and C++ compilers in the Guardian environment.
527187-017 Hewlett-Packard Company 751