Guardian Native C Library Calls Reference Manual (G06.28+, H06.05+)

Guardian Native C Library Calls (t - z) tmpnam_oss(3)
NAME
tmpnam_oss - Constructs the name for a temporary le (OSS tmpnam( ) function)
LIBRARY
G-series native Guardian processes: $SYSTEM.SYSnn.ZCRTLSRL
G-series native OSS processes: /G/system/sysnn/zcrtlsrl
H-series native Guardian processes: $SYSTEM.ZDLLnnn.ZCRTLDLL
H-series OSS processes: /G/system/zdllnnn/zcrtldll
SYNOPSIS
#include <stdio.h>
char *tmpnam(
char *s);
char *tmpnam_oss(
char *s);
PARAMETERS
s 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( ) OSS function and tmpnam_oss( ) function generate lenames for temporary
les.
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 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( ) 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 le naming conventions and structures of
the OSS and Guardian le 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.
527192-007 Hewlett-Packard Company 725