CLOSE(3spp)
NAME
close − delete a descriptor
SYNOPSIS
close(d)
int d;
DESCRIPTION
The close call deletes a file descriptor and performs any device driver defined activity necessary when terminating access to the file.
A close of all of a standalone programs descriptors is automatic on exit, but since there is a limit on the number of active descriptors per process, close is necessary for programs that deal with many descriptors.
RETURN VALUE
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.
ERRORS
Close will fail if:
[EBADF] D is not an active descriptor.
SEE ALSO
open(3spp), read(3spp), write(3spp), ioctl(3spp), lseek(3spp)