Guardian Native C Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)
tmpfile_oss(3) Guardian Native C Library Calls Reference Manual
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 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>
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.
For the TNS C runtime library only, the header file maps calls to tmpfile() to the variant that
matches the target compilation environment. 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 these 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.
7−28 Hewlett-Packard Company 527192-018