Guardian C Library Calls Reference Manual

Reference to Library Calls
Guardian TNS C Library Calls Reference Manual128833 3-19
close (supplementary)
close (supplementary)
The close function closes a file opened for alternate I/O.
file_des
is the descriptor denoting a file opened for alternate I/O.
Return Value
is zero if the operation is successful, or -1 if an error occurs.
Usage Guidelines
You must call the close function when you finish using a file.
Example
This example closes the file $a.b.c:
#include <fcntlh>
int status;
int filedes;
filedes = open("$a.b.c", 0_RDWR);
/* ... */
status = close(filedes);
if(status != 0) printf("Close of $a.b.c failed.");
#include <fcntlh>
int close(int file_des);