Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)
fopen_std_file(3) OSS Library Calls Reference Manual
NAME
fopen_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 fopen_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 fopen_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 fopen_std_file( ) function in Guardian modules (modules compiled for the Guar-
dian environment) within Guardian processes only.
RETURN VALUES
Upon successful completion, the value 0 (zero) is returned. Otherwise, fopen_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.
RELATED INFORMATION
Functions: fopen(3).
STANDARDS CONFORMANCE
The fopen_std_file( ) function is an HP extension to the XPG4 Version 2 specification.
2−120 Hewlett-Packard Company 527187-017