1 .\" Copyright (C) 1993 David Metcalfe (david@prism.demon.co.uk)
3 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
5 .\" References consulted:
6 .\" Linux libc source code
7 .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
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)"
13 closedir \- close a directory
16 .RI ( libc ", " \-lc )
19 .B #include <sys/types.h>
20 .B #include <dirent.h>
22 .BI "int closedir(DIR *" dirp );
27 function closes the directory stream associated with
31 also closes the underlying file descriptor associated with
33 The directory stream descriptor
40 function returns 0 on success.
41 On error, \-1 is returned, and
43 is set to indicate the error.
47 Invalid directory stream descriptor
50 For an explanation of the terms used in this section, see
58 Interface Attribute Value
61 T} Thread safety MT-Safe
67 POSIX.1-2001, POSIX.1-2008, SVr4, 4.3BSD.