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

OSS Library Calls (g - h) gfileno(3)
NAME
gfileno - Maps a stream pointer to a Guardian file number
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>
int gfileno(
FILE *stream);
PARAMETERS
stream Specifies the open stream.
DESCRIPTION
The gfileno( ) function returns the Guardian file number of a stream.
This function replaces calls to the fileno( ) and fdtogfn( ) functions to obtain the Guardian file
number corresponding to a file stream or file descriptor.
NOTES
The gfileno( ) can be called only by native processes. TNS and accelerated processes can call the
fileno( ) and fdtogfn( ) functions instead.
RETURN VALUES
Upon successful completion, the gfileno( ) function returns the Guardian file number associated
with the stream parameter. If the function is not successful, -1 is returned and errno is set.
ERRORS
If the following condition occurs, the gfileno( ) function sets errno to the corresponding value:
[EINVAL] The stream is an invalid Guardian stream.
STANDARDS CONFORMANCE
The gfileno( ) function is an HP extension to the XPG4 Version 2 specification.
527187-017 Hewlett-Packard Company 3159