Guardian Native C Library Calls Reference Manual (G06.25+, H06.03+)
Guardian Native C Library Calls (t - z) tmp
file_oss(3)
NAME
tmpfile_oss - Creates a temporary file (OSS tmpfile( ) 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>
FILE *tmpfile(void);
FILE *tmpfile_oss(void);
DESCRIPTION
The tmpfile() OSS function and tmpfile_oss( ) function create a temporary file and return its
FILE pointer. The file is opened for update. The temporary file is automatically deleted when the
process using it terminates.
These functions are identical in the OSS environment. Unless otherwise noted, this reference
page uses tmpfile() to refer to both the tmpfile() OSS function and tmpfile_oss() function.
Interoperability Variants
The C run-time library supports two variants of the tmpfile() function: tmpfile_oss() and
tmpfile_guardian(). The variants support the unique file naming conventions and structures of
the OSS and Guardian file systems, respectively.
The header file maps calls to tmpfile() to the variant that matches the target compilation environ-
ment. The target environment is set with the systype pragma.
Explicit calls to the tmpfile_oss() and tmpfile_guardian() variants in source code are only
made when the behavior of one environment is desired from the other environment.
tmpfile_oss() is functionally identical to the tmpfile() 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.
tmpfile_guardian() is functionally identical to the tmpfile() function of the Guardian environ-
ment. It is the same as setting systype guardian at compile-time. systype guardian is
the default setting for the C and C++ compilers in the Guardian environment.
To use the tmpfile_oss() or tmpfile_guardian() functions, specify the _TANDEM_SOURCE
feature test macro.
RETURN VALUES
Upon successful completion, the tmpfile() function returns a pointer to the stream of the file that
is created. Otherwise, it returns a null pointer, and sets errno to indicate the error.
ERRORS
If any of the following conditions occurs, the tmpfile() function sets errno to the corresponding
value:
[EINTR] A signal was caught during the tmpfile() function.
[EMFILE] The OPEN_MAX file descriptors are currently open in the calling process.
527192-003 Hewlett-Packard Company 7−15