manual page distributed with 4.1BSD
authorKirk McKusick <mckusick@ucbvax.Berkeley.EDU>
Fri, 10 May 1985 07:03:10 +0000 (23:03 -0800)
committerKirk McKusick <mckusick@ucbvax.Berkeley.EDU>
Fri, 10 May 1985 07:03:10 +0000 (23:03 -0800)
SCCS-vsn: lib/libc/sys/close.2 4.1

usr/src/lib/libc/sys/close.2 [new file with mode: 0644]

diff --git a/usr/src/lib/libc/sys/close.2 b/usr/src/lib/libc/sys/close.2
new file mode 100644 (file)
index 0000000..7263d88
--- /dev/null
@@ -0,0 +1,52 @@
+.\" Copyright (c) 1980 Regents of the University of California.
+.\" All rights reserved.  The Berkeley software License Agreement
+.\" specifies the terms and conditions for redistribution.
+.\"
+.\"    @(#)close.2     4.1 (Berkeley) %G%
+.\"
+.TH CLOSE 2 
+.UC 4
+.SH NAME
+close \- close a file
+.SH SYNOPSIS
+.B close(fildes)
+.SH DESCRIPTION
+Given
+a file descriptor such as returned from an
+.I open,
+.I creat,
+.I dup
+or
+.IR pipe (2)
+call,
+.I close
+closes the associated file.
+A close of all files is automatic on
+.I exit,
+but since
+there is a limit on the number of open files per process,
+.I close
+is necessary for programs which deal with many files.
+.PP
+Files are closed upon termination of a process, and
+certain high-numbered file descriptors are closed by
+.IR exec (2),
+and it is possible to arrange for others to be closed
+(see FIOCLEX in
+.IR ioctl (2)).
+.SH "SEE ALSO"
+creat(2), open(2), pipe(2), exec(2), ioctl(2)
+.SH DIAGNOSTICS
+Zero is returned if a file is closed;
+\-1 is returned for an unknown file descriptor.
+.SH "ASSEMBLER (PDP-11)"
+(close = 6.)
+.br
+(file descriptor in r0)
+.br
+.B sys close
+.PP
+.SH BUGS
+A file cannot be closed while there are pages which have been
+.I vread
+but not referenced.