opendir(3) Library Functions Manual opendir(3) opendir, fdopendir - LIBRARY Standard C library (libc, -lc) #include #include DIR *opendir(const char *name); DIR *fdopendir(int fd); glibc (. feature_test_macros(7)): fdopendir(): glibc 2.10: _POSIX_C_SOURCE >= 200809L glibc 2.10: _BSD_SOURCE opendir() , name, . . fdopendir() opendir(), , fd. fdopendir(), fd . The opendir() and fdopendir() functions return a pointer to the directory stream. On error, NULL is returned, and errno is set to indicate the error. EACCES . EBADF fd , . EMFILE . ENFILE . ENOENT , name . ENOMEM . ENOTDIR name . attributes(7). +----------------------------+----------------------------------------------------------+--------------------------+ | | | | +----------------------------+----------------------------------------------------------+--------------------------+ |opendir(), fdopendir() | | MT-Safe | +----------------------------+----------------------------------------------------------+--------------------------+ POSIX.1-2008. opendir() SVr4, 4.3BSD, POSIX.1-2001. fdopendir() POSIX.1-2008. glibc 2.4. readdir(3). dirfd(3). opendir() close-on-exec , DIR *. fdopendir() close-on-exec fd. POSIX.1-200x , fdopendir() close-on-exec fd. . open(2), closedir(3), dirfd(3), readdir(3), rewinddir(3), scandir(3), seekdir(3), telldir(3) Azamat Hackimov , Konstantin Shvaykovskiy , Yuri Kozlov ; GNU 3 , . . , , . Linux man-pages 6.06 31 2023 . opendir(3)