Guardian Native C Library Calls Reference Manual (G06.27+)
gfileno(3) Guardian Native C Library Calls Reference Manual
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 native Guardian processes: $SYSTEM.ZDLLnnn.ZCRTLDLL
H-series OSS processes: /G/system/zdllnnn/zcrtldll
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.
3−46 Hewlett-Packard Company 527192-004