The Single UNIX ® Specification, Version 2
Copyright © 1997 The Open Group

 NAME

fileno - map a stream pointer to a file descriptor

 SYNOPSIS



#include <stdio.h>

int fileno(FILE *stream);

 DESCRIPTION

The fileno() function returns the integer file descriptor associated with the stream pointed to by stream.

 RETURN VALUE

Upon successful completion, fileno() returns the integer value of the file descriptor associated with stream. Otherwise, the value -1 is returned and errno is set to indicate the error.

 ERRORS

The fileno() function may fail if:
[EBADF]
The stream argument is not a valid stream.

 EXAMPLES

None.

 APPLICATION USAGE

None.

 FUTURE DIRECTIONS

None.

 SEE ALSO

fdopen(), fopen(), stdin, <stdio.h>, Standard I/O Streans.

DERIVATION

Derived from Issue 1 of the SVID.

UNIX ® is a registered Trademark of The Open Group.
Copyright © 1997 The Open Group
[ Main Index | XSH | XCU | XBD | XCURSES | XNS ]