Guardian Native C Library Calls Reference Manual (G06.28+, H06.05+)
fileno(3) Guardian Native C Library Calls Reference Manual
NAME
fileno - Maps a stream pointer to a file descriptor
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 fileno(
FILE *stream);
PARAMETERS
stream Specifies the input stream.
DESCRIPTION
The fileno() function returns the file descriptor of a stream.
NOTES
OSS files have file descriptors. Guardian files have file numbers. Use this function only on an
opened OSS file.
RETURN VALUES
Upon successful completion, the fileno() function returns the file descriptor associated with the
stream parameter. Otherwise, the fileno() function returns -1 and sets errno.
ERRORS
If the following condition occurs, the fileno() function sets errno to the corresponding value.
[EINVAL] The stream is an invalid stream.
RELATED INFORMATION
Functions: clearerr(3), fdopen(3), feof(3), ferror(3), fopen(3), open(2).
STANDRDS CONFORMANCE
This function conforms to the Single UNIX Specification, Version 2, with the following excep-
tion:
• The errno value [EINVAL] is returned instead of [EBADF].
2−24 Hewlett-Packard Company 527192-007