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