FILENO(3S)
NAME
fileno − map stream pointer to file descriptor
SYNOPSIS
#include <stdio.h>
int fileno (stream)
FILE
∗stream;
DESCRIPTION
Fileno returns the integer file descriptor associated with the named stream; see open(2).
The following symbolic values in <unistd.h> define the file descriptors associated with stdin, stdout, and stderr when a program is started :
STDIN_FILENO Value of zero for standard input, stdin.
STDOUT_FILENO
Value of 1 for standard output, stdout.
STDERR_FILENO
Value of 2 for standard error, stderr.
DIAGNOSTICS
Upon error, fileno will return a -1.
SEE ALSO
STANDARDS CONFORMANCE
fileno: SVID2, XPG2, XPG3, POSIX.1, FIPS 151-1
Hewlett-Packard Company — HP-UX Release 7.0: Sept 1989