]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/closedir.3
All pages: Remove the 5th argument to .TH
[thirdparty/man-pages.git] / man3 / closedir.3
CommitLineData
fea681da
MK
1.\" Copyright (C) 1993 David Metcalfe (david@prism.demon.co.uk)
2.\"
5fbde956 3.\" SPDX-License-Identifier: Linux-man-pages-copyleft
fea681da
MK
4.\"
5.\" References consulted:
6.\" Linux libc source code
7.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
8.\" 386BSD man pages
9.\" Modified Sat Jul 24 21:25:52 1993 by Rik Faith (faith@cs.unc.edu)
10.\" Modified 11 June 1995 by Andries Brouwer (aeb@cwi.nl)
45186a5d 11.TH CLOSEDIR 3 2021-03-22 "Linux man-pages (unreleased)"
fea681da
MK
12.SH NAME
13closedir \- close a directory
b813014f
AC
14.SH LIBRARY
15Standard C library
16.RI ( libc ", " \-lc )
fea681da
MK
17.SH SYNOPSIS
18.nf
19.B #include <sys/types.h>
fea681da 20.B #include <dirent.h>
68e4db0a 21.PP
6dea120e 22.BI "int closedir(DIR *" dirp );
fea681da
MK
23.fi
24.SH DESCRIPTION
60a90ecd
MK
25The
26.BR closedir ()
27function closes the directory stream associated with
c6fa0841 28.IR dirp .
7134d7e6
GS
29A successful call to
30.BR closedir ()
08eaa638 31also closes the underlying file descriptor associated with
7134d7e6 32.IR dirp .
c6fa0841
MK
33The directory stream descriptor
34.I dirp
35is not available
fea681da 36after this call.
47297adb 37.SH RETURN VALUE
60a90ecd
MK
38The
39.BR closedir ()
40function returns 0 on success.
cca657e2
MK
41On error, \-1 is returned, and
42.I errno
f6a4078b 43is set to indicate the error.
fea681da
MK
44.SH ERRORS
45.TP
46.B EBADF
c6fa0841
MK
47Invalid directory stream descriptor
48.IR dirp .
fbbf0faf
MS
49.SH ATTRIBUTES
50For an explanation of the terms used in this section, see
51.BR attributes (7).
c466875e
MK
52.ad l
53.nh
fbbf0faf
MS
54.TS
55allbox;
c466875e 56lbx lb lb
fbbf0faf
MS
57l l l.
58Interface Attribute Value
59T{
60.BR closedir ()
61T} Thread safety MT-Safe
62.TE
c466875e
MK
63.hy
64.ad
65.sp 1
3113c7f3 66.SH STANDARDS
aa4533ed 67POSIX.1-2001, POSIX.1-2008, SVr4, 4.3BSD.
47297adb 68.SH SEE ALSO
fea681da
MK
69.BR close (2),
70.BR opendir (3),
71.BR readdir (3),
72.BR rewinddir (3),
73.BR scandir (3),
74.BR seekdir (3),
75.BR telldir (3)