1CLOSEDIR(3) Linux Programmer's Manual CLOSEDIR(3)
2
3
4
6 closedir - close a directory
7
9 #include <sys/types.h>
10
11 #include <dirent.h>
12
13 int closedir(DIR *dirp);
14
16 The closedir() function closes the directory stream associated with
17 dirp. A successful call to closedir() also closes the underlying file
18 descriptor associated with dirp. The directory stream descriptor dirp
19 is not available after this call.
20
22 The closedir() function returns 0 on success. On error, -1 is re‐
23 turned, and errno is set appropriately.
24
26 EBADF Invalid directory stream descriptor dirp.
27
29 For an explanation of the terms used in this section, see at‐
30 tributes(7).
31
32 ┌───────────┬───────────────┬─────────┐
33 │Interface │ Attribute │ Value │
34 ├───────────┼───────────────┼─────────┤
35 │closedir() │ Thread safety │ MT-Safe │
36 └───────────┴───────────────┴─────────┘
38 POSIX.1-2001, POSIX.1-2008, SVr4, 4.3BSD.
39
41 close(2), opendir(3), readdir(3), rewinddir(3), scandir(3), seekdir(3),
42 telldir(3)
43
45 This page is part of release 5.10 of the Linux man-pages project. A
46 description of the project, information about reporting bugs, and the
47 latest version of this page, can be found at
48 https://www.kernel.org/doc/man-pages/.
49
50
51
52 2015-08-08 CLOSEDIR(3)