2 .\" Copyright (C) 1993 David Metcalfe (david@prism.demon.co.uk)
4 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
6 .\" References consulted:
7 .\" Linux libc source code
8 .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
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)"
14 closedir \- close a directory
17 .RI ( libc ", " \-lc )
20 .B #include <sys/types.h>
21 .B #include <dirent.h>
23 .BI "int closedir(DIR *" dirp );
28 function closes the directory stream associated with
32 also closes the underlying file descriptor associated with
34 The directory stream descriptor
41 function returns 0 on success.
42 On error, \-1 is returned, and
44 is set to indicate the error.
48 Invalid directory stream descriptor
51 For an explanation of the terms used in this section, see
59 Interface Attribute Value
62 T} Thread safety MT-Safe
68 POSIX.1-2001, POSIX.1-2008, SVr4, 4.3BSD.