]>
Commit | Line | Data |
---|---|---|
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 |
13 | closedir \- close a directory | |
b813014f AC |
14 | .SH LIBRARY |
15 | Standard 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 |
25 | The |
26 | .BR closedir () | |
27 | function closes the directory stream associated with | |
c6fa0841 | 28 | .IR dirp . |
7134d7e6 GS |
29 | A successful call to |
30 | .BR closedir () | |
08eaa638 | 31 | also closes the underlying file descriptor associated with |
7134d7e6 | 32 | .IR dirp . |
c6fa0841 MK |
33 | The directory stream descriptor |
34 | .I dirp | |
35 | is not available | |
fea681da | 36 | after this call. |
47297adb | 37 | .SH RETURN VALUE |
60a90ecd MK |
38 | The |
39 | .BR closedir () | |
40 | function returns 0 on success. | |
cca657e2 MK |
41 | On error, \-1 is returned, and |
42 | .I errno | |
f6a4078b | 43 | is set to indicate the error. |
fea681da MK |
44 | .SH ERRORS |
45 | .TP | |
46 | .B EBADF | |
c6fa0841 MK |
47 | Invalid directory stream descriptor |
48 | .IR dirp . | |
fbbf0faf MS |
49 | .SH ATTRIBUTES |
50 | For 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 |
55 | allbox; | |
c466875e | 56 | lbx lb lb |
fbbf0faf MS |
57 | l l l. |
58 | Interface Attribute Value | |
59 | T{ | |
60 | .BR closedir () | |
61 | T} Thread safety MT-Safe | |
62 | .TE | |
c466875e MK |
63 | .hy |
64 | .ad | |
65 | .sp 1 | |
3113c7f3 | 66 | .SH STANDARDS |
aa4533ed | 67 | POSIX.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) |