close — close a file descriptor
int close(int fildes);
closes the file descriptor indicated by
is a file descriptor obtained from a
All associated file segments which have been locked by this process with the
function are released (i.e., unlocked).
Upon successful completion,
returns a value of 0; otherwise, it returns -1 and sets
to indicate the error.
fails if the any of following conditions are encountered:
is not a valid open file descriptor.
An attempt to close a slow device or connection or
file with pending aio requests was interrupted by a
signal. The file descriptor still points to an open
device or connection or file.
Not enough space on the file system.
This error can occur when closing a file on an
system call is executed on a local file system
and if a new buffer needs to be allocated to hold the data,
the buffer is mapped onto the disk at that time.
A full disk is detected at this time and
returns an error.
system call is executed on an
the new buffer is allocated without communicating with the
server to see if there is space for the buffer
It is only when the buffer is written to the server
(at file close or the buffer is full)
that the disk-full condition is detected.]
close(): AES, SVID2, SVID3, XPG2, XPG3, XPG4, FIPS 151-2, POSIX.1