HP C/iX Library Reference Manual (30026-90004)

154 Chapter5
HP C/iX Library Function Descriptions
fileno
fileno
Maps a stream pointer to a file descriptor.
Syntax
#include <stdio.h>
int fileno (FILE *
stream
);
Parameters
stream
A pointer to an open stream.
Return Values
0 An open file descriptor associated with
stream
.
Description
The fileno function returns the file descriptor associated with
stream
.
The following symbolic values, located in <unistd.h>, define the file descriptors associated
with stdin, stdout, and stderr streams when the application is started:
This routine is implemented as a macro in <stdio.h> and as a function.
See Also
fdopen(), open(), POSIX.1 8.2.1
File Descriptor
Symbolic Value
Stream Description Value
STDIN_FILENO Standard input stream stdin 0
STDOUT_FILENO Standard output stream stdout 1
STDERR_FILENO Standard error stream stderr 2