CLOSE(2) — Silicon Graphics
NAME
close − close a file descriptor
SYNOPSIS
int close (fildes)
int fildes;
DESCRIPTION
Fildes is a file descriptor obtained from a creat, open, dup, fcntl, or pipe system call. Close closes the file descriptor indicated by fildes. A close of all files is automatic on exit, but since there is a limit of 40 on the number of open files per process, close is necessary for programs which deal with many files.
Close will fail if fildes is not a valid open file descriptor. [EBADF]
RETURN VALUE
Upon successful completion, a value of 0 is returned. Otherwise, a value of −1 is returned and errno is set to indicate the error.
SEE ALSO
creat(2), dup(2), exec(2), fcntl(2), open(2), pipe(2).
ASSEMBLER
moveq#6,D0
movlfildes,A0
trap#0
Carry bit set on failure and cleared on success.
Version 2.5r1 — October 29, 1986