[JM:02650] [POST:DP] LDP man-pages telldir.3

Back to archive index
Akihiro Motoki amoto****@gmail*****
2021年 7月 8日 (木) 22:12:02 JST


<STATUS>
stat: DP
ppkg: LDP man-pages
page: telldir.3
date: 2021/07/07
mail: amoto****@gmail*****
name: Akihiro Motoki
</STATUS>

.\"O .TH TELLDIR 3  2017-09-15 "" "Linux Programmer's Manual"
.TH TELLDIR 3 2017\-09\-15 "" "Linux Programmer's Manual"
.\"O ----------------------------------------
.\"O .SH NAME
.\"O telldir \- return current location in directory stream
.SH 名前
telldir \- ディレクトリストリーム中の現在位置を返す
.\"O ----------------------------------------
.\"O .SH SYNOPSIS
.\"O .nf
.\"O .B #include <dirent.h>
.SH 書式
.nf
\fB#include <dirent.h>\fP
.\"O ----------------------------------------
.\"O .PP
.\"O .BI "long telldir(DIR *" dirp );
.\"O .fi
.PP
\fBlong telldir(DIR *\fP\fIdirp\fP\fB);\fP
.fi
.\"O ----------------------------------------
.\"O .PP
.PP
.\"O ----------------------------------------
.\"O .RS -4
.\"O Feature Test Macro Requirements for glibc (see
.\"O .BR feature_test_macros (7)):
.RS -4
glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
.\"O ----------------------------------------
.\"O .RE
.RE
.\"O ----------------------------------------
.\"O .PP
.\"O .BR telldir ():
.\"O  _XOPEN_SOURCE
.\"O     || /* Glibc since 2.19: */ _DEFAULT_SOURCE
.\"O     || /* Glibc versions <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
.PP
\fBtelldir\fP():
 _XOPEN_SOURCE
    || /* glibc 2.19 以降: */ _DEFAULT_SOURCE
    || /* glibc 2.19 以前: */ _BSD_SOURCE || _SVID_SOURCE
.\"O ----------------------------------------
.\"O .SH DESCRIPTION
.\"O The
.\"O .BR telldir ()
.\"O function returns the current location associated with
.\"O the directory stream \fIdirp\fP.
.SH 説明
\fBtelldir\fP() 関数は、ディレクトリストリーム \fIdirp\fP の現在位置を返す。
.\"O ----------------------------------------
.\"O .SH RETURN VALUE
.\"O On success, the
.\"O .BR telldir ()
.\"O function returns the current location
.\"O in the directory stream.
.\"O On error, \-1 is returned, and
.\"O .I errno
.\"O is set appropriately.
.SH 返り値
成功した場合、 \fBtelldir\fP()  関数はディレクトリストリーム中の現在位置を返す。 エラーの場合、\-1 が返り、 \fIerrno\fP
が適切に設定される。
.\"O ----------------------------------------
.\"O .SH ERRORS
.SH エラー
.\"O ----------------------------------------
.\"O .TP
.\"O .B EBADF
.\"O Invalid directory stream descriptor \fIdirp\fP.
.TP
\fBEBADF\fP
ディレクトリストリームディスクリプター \fIdirp\fP が無効である。
.\"O ----------------------------------------
.\"O .SH ATTRIBUTES
.\"O For an explanation of the terms used in this section, see
.\"O .BR attributes (7).
.\"O .TS
.\"O allbox;
.\"O lb lb lb
.\"O l l l.
.\"O Interface Attribute Value
.\"O T{
.\"O .BR telldir ()
.\"O T} Thread safety MT-Safe
.\"O .TE
.SH 属性
この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。
.TS
allbox;
lb lb lb
l l l.
インターフェース 属性 値
T{
\fBtelldir\fP()
T} Thread safety MT\-Safe
.TE
.\"O ----------------------------------------
.\"O .SH CONFORMING TO
.\"O POSIX.1-2001, POSIX.1-2008, 4.3BSD.
.SH 準拠
POSIX.1\-2001, POSIX.1\-2008, 4.3BSD.
.\"O ----------------------------------------
.\"O .SH NOTES
.\"O In glibc up to version 2.1.1, the return type of
.\"O .BR telldir ()
.\"O was
.\"O .IR off_t .
.\"O POSIX.1-2001 specifies
.\"O .IR long ,
.\"O and this is the type used since glibc 2.1.2.
.SH 注意
バージョン 2.1.1 以前の glibc では、 \fBtelldir\fP() の返り値の型は \fIoff_t\fP であった。
POSIX.1\-2001
では \fIlong\fP と規定されており、glibc 2.1.2 以降では \fIlong\fP になっている。
.\"O ----------------------------------------
.\"O .PP
.\"O In early filesystems, the value returned by
.\"O .BR telldir ()
.\"O was a simple file offset within a directory.
.\"O Modern filesystems use tree or hash structures, rather than flat tables,
.\"O to represent directories.
.\"O On such filesystems, the value returned by
.\"O .BR telldir ()
.\"O (and used internally by
.\"O .BR readdir (3))
.\"O is a "cookie" that is used by the implementation
.\"O to derive a position within a directory.
.\"O Application programs should treat this strictly as an opaque value, making
.\"O .I no
.\"O assumptions about its contents.
.PP
初期のファイルシステムでは、 \fBtelldir\fP()
が返す値は単なるディレクトリ内のファイルオフセットであった。最近のファイルシステムでは、ディレクトリを表現するのに、フラットなテーブルではなく、ツリー構造やハッシュ構造が使用されている。このようなファイルシステムでは、
\fBtelldir\fP() が返す値 (および \fBreaddir\fP(3) が内部で使用する値)
は、ファイルシステム実装がディレクトリ内での位置を得るのに使用する "cookie"
となる。アプリケーションプログラムでは、必ずこの値を内容の意識せず単なる値として扱うべきであり、その内容について前提を持つべきでは「ない」。
.\"O ----------------------------------------
.\"O .SH SEE ALSO
.\"O .BR closedir (3),
.\"O .BR opendir (3),
.\"O .BR readdir (3),
.\"O .BR rewinddir (3),
.\"O .BR scandir (3),
.\"O .BR seekdir (3)
.SH 関連項目
\fBclosedir\fP(3), \fBopendir\fP(3), \fBreaddir\fP(3), \fBrewinddir\fP(3),
\fBscandir\fP(3), \fBseekdir\fP(3)
.\"O ----------------------------------------
.\"O .SH COLOPHON
.\"O This page is part of release 5.10 of the Linux
.\"O .I man-pages
.\"O project.
.\"O A description of the project,
.\"O information about reporting bugs,
.\"O and the latest version of this page,
.\"O can be found at
.\"O \%https://www.kernel.org/doc/man\-pages/.
.SH この文書について
この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は
\%https://www.kernel.org/doc/man\-pages/ に書かれている。
.\"O ----------------------------------------


linuxjm-discuss メーリングリストの案内
Back to archive index