Guardian C Library Calls Reference Manual
fcntl (supplementary)
3-36 128833—Guardian TNS C Library Calls Reference Manual
Reference to Library Calls
Return Value
depends upon command:
•
For F_GETFL, fcntl returns the file open-option flags.
•
For F_GETDTYPE, fcntl returns the device type of the file.
•
For F_GETFCODE, fcntl returns the file code if the file is a disk file, or -1 if it
is not.
•
For all others, fcntl returns 1 if the operation is successful, or -1 if an error occurs.
Usage Guidelines
•
The commands provided by fcntl are:
Command Option Operation
F_FLUSH
*
none Flushes buffered output.
F_SETTAB
*
F_ON / F_OFF Turns tab expansion on or off.
F_SETBUF
*
F_ON / F_OFF Turns terminal output buffering on or off.
F_GETFL none Returns the file’s open-option flags.
F_SETFL flags Sets the file’s open-option flags.
F_GETDTYPE
*
none Returns the file’s device type.
F_GETFCODE
*
none Returns the file code for a disk file; otherwise,
returns -1.
F_GETFN
*
none Returns the file number.
*
indicates that the command is a Tandem extension to the ISO C Standard.