#include <sys/types.h>
#include <dirent.h>
int closedir(DIR *dirp);
The closedir() function closes the directory stream associated with dirp. A successful call to closedir() also closes the underlying file descriptor associated with dirp. The directory stream descriptor dirp is not available after this call.
The closedir() function returns 0 on success. On error, -1 is returned, and errno is set to indicate the error.
- EBADF
- 무효한 디렉토리 스트림 기술자 dirp.
이 섹션에서 사용되는 용어에 대한 설명은 attributes(7)EN을 참조하십시오.
| 상호 작용 | 속성 | 번호 |
| closedir() | Thread safety | MT-Safe |
POSIX.1-2001, POSIX.1-2008, SVr4, 4.3BSD.