CLOSE(2) System Calls CLOSE(2)
close - delete a descriptor
int close(int fd);
The close call deletes a descriptor from the per-process file descrip-
tor table. If this is the last reference to the underlying object, the
object will be deactivated. For example, on the last close of a file
the current seek pointer associated with the file is lost; on the last
close of a socket(2) associated naming information and queued data are
discarded; on the last close of a file holding an advisory lock the
lock is released (see further flock(2)).
Upon successful completion, a value of 0 is returned. Otherwise, a
value of -1 is returned and the global integer variable errno is set to
indicate the error.
Close will fail if:
EBADF fd is not an active descriptor.
EINTR An interrupt was received.
accept(2), flock(2), open(2), pipe(2), socket(2), socketpair(2),
close conforms to IEEE Std 1003.1-1988 (POSIX).
GNO 22 January 1997 CLOSE(2)
Man(1) output converted with