]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/opendir.3
sync
[thirdparty/man-pages.git] / man3 / opendir.3
CommitLineData
fea681da
MK
1.\" Copyright (C) 1993 David Metcalfe (david@prism.demon.co.uk)
2.\"
3.\" Permission is granted to make and distribute verbatim copies of this
4.\" manual provided the copyright notice and this permission notice are
5.\" preserved on all copies.
6.\"
7.\" Permission is granted to copy and distribute modified versions of this
8.\" manual under the conditions for verbatim copying, provided that the
9.\" entire resulting derived work is distributed under the terms of a
10.\" permission notice identical to this one.
c13182ef 11.\"
fea681da
MK
12.\" Since the Linux kernel and libraries are constantly changing, this
13.\" manual page may be incorrect or out-of-date. The author(s) assume no
14.\" responsibility for errors or omissions, or for damages resulting from
15.\" the use of the information contained herein. The author(s) may not
16.\" have taken the same level of care in the production of this manual,
17.\" which is licensed free of charge, as they might when working
18.\" professionally.
c13182ef 19.\"
fea681da
MK
20.\" Formatted or processed versions of this manual, if unaccompanied by
21.\" the source, must acknowledge the copyright and authors of this work.
22.\"
23.\" References consulted:
24.\" Linux libc source code
25.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
26.\" 386BSD man pages
27.\" Modified Sat Jul 24 18:46:01 1993 by Rik Faith (faith@cs.unc.edu)
28.\" Modified 11 June 1995 by Andries Brouwer (aeb@cwi.nl)
29.TH OPENDIR 3 1995-06-11 "" "Linux Programmer's Manual"
30.SH NAME
31opendir \- open a directory
32.SH SYNOPSIS
33.nf
34.B #include <sys/types.h>
35.br
36.B #include <dirent.h>
37.sp
38.BI "DIR *opendir(const char *" name );
39.fi
40.SH DESCRIPTION
63aa9df0 41The \fBopendir\fP() function opens a directory stream corresponding to the
c13182ef
MK
42directory \fIname\fP, and returns a pointer to the directory stream.
43The stream is positioned at the first entry in the directory.
fea681da 44.SH "RETURN VALUE"
63aa9df0 45The \fBopendir\fP() function returns a pointer to the directory stream.
cca657e2
MK
46On error, NULL is returned, and
47.I errno
48is set appropriately.
fea681da
MK
49.SH ERRORS
50.TP
51.B EACCES
52Permission denied.
53.TP
54.B EMFILE
55Too many file descriptors in use by process.
56.TP
57.B ENFILE
58Too many files are currently open in the system.
59.TP
60.B ENOENT
61Directory does not exist, or \fIname\fP is an empty string.
62.TP
63.B ENOMEM
64Insufficient memory to complete the operation.
65.TP
66.B ENOTDIR
67\fIname\fP is not a directory.
68.SH NOTES
69The underlying file descriptor of the directory stream can be obtained using
70.BR dirfd (3).
71.SH "CONFORMING TO"
68e1685c 72SVr4, 4.3BSD, POSIX.1-2001.
fea681da
MK
73.SH "SEE ALSO"
74.BR open (2),
75.BR closedir (3),
76.BR dirfd (3),
77.BR readdir (3),
78.BR rewinddir (3),
79.BR scandir (3),
80.BR seekdir (3),
81.BR telldir (3)