getdirentriesのヘルプ・マニュアル
日本語 英語
getdirentries --help
man getdirentries
GETDIRENTRIES(3) Linux Programmer’s Manual GETDIRENTRIES(3)
名前
getdirentries - ディレクトリのエントリをファイルシステムに依存しない形
式で取得する
書式
glibc 向けの機能検査マクロの要件 (feature_test_macros(7) 参照):
getdirentries(): _BSD_SOURCE || _SVID_SOURCE #include
ssize_t getdirentries(int fd, char *buf, size_t nbytes , off_t *basep);
説明
fd で指定されたディレクトリからエントリを読み、 buf に格納する。最大で
nbytes が読み込まれる。読み込みはオフセット *basep から開始され、読み込
み終了時には *basep は新しい位置に更新される。
返り値
getdirentries() は読み込んだバイト数を返すか、ディレクトリの最後にきた
場合は 0 を返す。エラーが起こったら -1 を返し、 errno をエラーに対応 す
る値にセットする。
エラー
詳細は Linux のライブラリソースコードを読んでほしい。
準拠
POSIX.1-2001 にはない。 BSD に存在し、他にもいくつかのシステムにもある
。代わりに opendir(3) と readdir(3) を使用すること。
関連項目
lseek(2), open(2)
GNU 2007-07-26 GETDIRENTRIES(3)
GETDIRENTRIES(3) Linux Programmer’s Manual GETDIRENTRIES(3)
NAME
getdirentries - get directory entries in a file system-independent for-
mat
SYNOPSIS
#include
ssize_t getdirentries(int fd, char *buf, size_t nbytes , off_t *basep);
Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
getdirentries(): _BSD_SOURCE || _SVID_SOURCE
DESCRIPTION
Read directory entries from the directory specified by fd into buf. At
most nbytes are read. Reading starts at offset *basep, and *basep is
updated with the new position after reading.
RETURN VALUE
getdirentries() returns the number of bytes read or zero when at the
end of the directory. If an error occurs, -1 is returned, and errno is
set appropriately.
ERRORS
See the Linux library source code for details.
CONFORMING TO
Not in POSIX.1-2001. Present on the BSDs, and a few other systems.
Use opendir(3) and readdir(3) instead.
SEE ALSO
lseek(2), open(2)
COLOPHON
This page is part of release 3.22 of the Linux man-pages project. A
description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
GNU 2007-07-26 GETDIRENTRIES(3)