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

OSS Library Calls (e - f) fopen64_std_file(3)
NAME
fopen64_std_file - Opens standard input, standard output, or standard error file
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>
short fopen64_std_file (
short file
[,short die_on_error]
);
PARAMETERS
file Specifies which standard file to open: 0 indicates standard input, 1 indicates
standard output, and 2 indicates standard error.
die_on_error Indicates what occurs if there is an error when attempting to open the file. If
die_on_error is a nonzero value and an open error occurs, normal process shut-
down sequence runs, which includes writing a standard message and calling the
Guardian system procedure PROCESS_STOP_. If die_on_error parameter is
omitted or is zero, the function returns to the calling function on an error.
DESCRIPTION
The fopen64_std_file( ) function is similar to the open_std_file( ) function except that, in addi-
tion to supporting smaller files, the open64_std_file( ) function supports OSS files that have a file
offset maximum larger than 2 gigabytes and Guardian files that have a file offset maximum larger
than 4 gigabytes (Guardian Format 2 files).
An application can explicitly call this function when you compile the application using the
#define _LARGEFILE64_SOURCE 1 feature test macro or an equivalent compiler command
option.
An application call to fopen_std_file( ) is automatically mapped to this function when you com-
pile the application using the #define _FILE_OFFSET_BITS 64 feature test macro or an
equivalent compiler command option.
The fopen64_std_file( ) function opens the specified standard input, standard output, or standard
error file. This function is used if the standard file was not opened automatically because the
NOSTDFILES pragma was specified or because the main function was not written in the C
language.
You can call the fopen64_std_file( ) function in Guardian modules (modules compiled for the
Guardian environment) within Guardian processes only.
RETURN VALUES
Upon successful completion, the value 0 (zero) is returned. Otherwise, fopen64_std_file( )
returns 1 if the file is already open, -1 if there is a problem with a parameter, and -2 if the open
failed. The -2 is not returned if a nonzero value was passed for the die_on_error parameter.
527187-017 Hewlett-Packard Company 2111