Guardian C Library Calls Reference Manual
Reference to Library Calls
Guardian TNS C Library Calls Reference Manual—128833 3-35
fcntl (supplementary)
fcloseall (supplementary)
The fcloseall function closes all files opened for ANSI I/O and alternate I/O, including
stdin, stdout, and stderr.
Usage Guidelines
•
If one of the files was written to, fcloseall writes any data in the buffer to the file.
•
Whenever a program calls the exit function or returns from main, C closes all open
files automatically. You should, however, close all files explicitly by calling fclose or
fcloseall.
fcntl (supplementary)
The fcntl function provides a number of file control-operations. By specifying the
command argument, you select a file-control operation.
file_des
is the descriptor denoting a file opened for alternate I/O.
command
is one of the command constants listed under “Usage Guidelines.” These constants
are object-like macros defined in the fcntlh header.
option
is, depending on the command, one of the following:
•
A flag word whose attribute bits are represented by object-like macros defined in the
header fcntlh. See the open function for a description of these macros.
•
An on or off indicator represented by the object-like macros F_ON or F_ON,
defined in the header fcntlh.
#include <stdioh>
void fcloseall(void);
#include <fcntlh>
int fcntl(int file_des, int command [, int option]);