]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/closedir.3
Many pages: Use correct letter case in page titles (TH)
[thirdparty/man-pages.git] / man3 / closedir.3
1 .\" Copyright (C) 1993 David Metcalfe (david@prism.demon.co.uk)
2 .\"
3 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
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)
11 .TH closedir 3 (date) "Linux man-pages (unreleased)"
12 .SH NAME
13 closedir \- close a directory
14 .SH LIBRARY
15 Standard C library
16 .RI ( libc ", " \-lc )
17 .SH SYNOPSIS
18 .nf
19 .B #include <sys/types.h>
20 .B #include <dirent.h>
21 .PP
22 .BI "int closedir(DIR *" dirp );
23 .fi
24 .SH DESCRIPTION
25 The
26 .BR closedir ()
27 function closes the directory stream associated with
28 .IR dirp .
29 A successful call to
30 .BR closedir ()
31 also closes the underlying file descriptor associated with
32 .IR dirp .
33 The directory stream descriptor
34 .I dirp
35 is not available
36 after this call.
37 .SH RETURN VALUE
38 The
39 .BR closedir ()
40 function returns 0 on success.
41 On error, \-1 is returned, and
42 .I errno
43 is set to indicate the error.
44 .SH ERRORS
45 .TP
46 .B EBADF
47 Invalid directory stream descriptor
48 .IR dirp .
49 .SH ATTRIBUTES
50 For an explanation of the terms used in this section, see
51 .BR attributes (7).
52 .ad l
53 .nh
54 .TS
55 allbox;
56 lbx lb lb
57 l l l.
58 Interface Attribute Value
59 T{
60 .BR closedir ()
61 T} Thread safety MT-Safe
62 .TE
63 .hy
64 .ad
65 .sp 1
66 .SH STANDARDS
67 POSIX.1-2001, POSIX.1-2008, SVr4, 4.3BSD.
68 .SH SEE ALSO
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)