fileno [ HP C/iX Library Reference Manual ] MPE/iX 5.0 Documentation
HP C/iX Library Reference Manual
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:
----------------------------------------------------------------------------------------------
| File Descriptor | Stream Description | Value |
| Symbolic Value | | |
----------------------------------------------------------------------------------------------
- STDIN_FILENO - Standard input stream stdin - 0 -
----------------------------------------------------------------------------------------------
- STDOUT_FILENO - Standard output stream stdout - 1 -
----------------------------------------------------------------------------------------------
- STDERR_FILENO - Standard error stream stderr - 2 -
----------------------------------------------------------------------------------------------
This routine is implemented as a macro in <stdio.h> and as a function.
See Also
fdopen(), open(), POSIX.1 8.2.1
MPE/iX 5.0 Documentation