closedir

Section: C Library Functions (3)
Updated: 2026-02-08
Index JM Home Page roff page
 

名前

closedir - ディレクトリをクローズする  

ライブラリ

標準 C ライブラリ (libc,~-lc)  

書式

#include <sys/types.h>
#include <dirent.h>

int closedir(DIR *dirp);
 

説明

closedir() 関数は dirp に関連付けられた ディレクトリストリームをクローズする。 closedir() の呼び出しが成功すると、 dirp に関連付けられた ファイルディスクリプターもクローズされる。 ディレクトリストリームディスクリプター (directory stream descriptor) dirp は、 この呼び出しの後では使用することができない。  

返り値

The closedir() function returns 0 on success. On error, -1 is returned, and errno is set to indicate the error.  

エラー

EBADF
ディレクトリストリームディスクリプター dirp が無効である。
 

属性

この節で使用されている用語の説明については、 attributes(7) を参照。
インターフェース属性値
closedir() Thread safetyMT-Safe
 

標準規格

POSIX.1-2008.  

歴史

POSIX.1-2001, SVr4, 4.3BSD.  

関連項目

close(2), opendir(3), readdir(3), rewinddir(3), scandir(3), seekdir(3), telldir(3)


 

Index

名前
ライブラリ
書式
説明
返り値
エラー
属性
標準規格
歴史
関連項目

This document was created by man2html, using the manual pages.