Bell 32V development
[unix-history] / usr / man / man2 / close.2
CommitLineData
8d83b560
TL
1.TH CLOSE 2
2.SH NAME
3close \- close a file
4.SH SYNOPSIS
5.B close(fildes)
6.PP
7.SH DESCRIPTION
8Given
9a file descriptor such as returned from an
10.I open,
11.I creat,
12.I dup
13or
14.IR pipe (2)
15call,
16.I close
17closes the associated file.
18A close of all files is automatic on
19.I exit,
20but since
21there is a limit on the number of open files per process,
22.I close
23is necessary for programs which deal with many files.
24.PP
25Files are closed upon termination of a process, and
26certain high-numbered file descriptors are closed by
27.IR exec (2).
28.SH "SEE ALSO"
29creat(2), open(2), pipe(2), exec(2)
30.SH DIAGNOSTICS
31Zero is returned if a file is closed;
32\-1 is returned for an unknown file descriptor.
33.SH "ASSEMBLER (PDP-11)"
34(close = 6.)
35.br
36(file descriptor in r0)
37.br
38.B sys close
39.PP