Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)
OSS Library Calls (e - f) fileno(3)
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 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 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].
527187-017 Hewlett-Packard Company 2−73