.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) .\" .\" %%%LICENSE_START(VERBATIM) .\" Permission is granted to make and distribute verbatim copies of this .\" manual provided the copyright notice and this permission notice are .\" preserved on all copies. .\" .\" Permission is granted to copy and distribute modified versions of this .\" manual under the conditions for verbatim copying, provided that the .\" entire resulting derived work is distributed under the terms of a .\" permission notice identical to this one. .\" .\" Since the Linux kernel and libraries are constantly changing, this .\" manual page may be incorrect or out-of-date. The author(s) assume no .\" responsibility for errors or omissions, or for damages resulting from .\" the use of the information contained herein. The author(s) may not .\" have taken the same level of care in the production of this manual, .\" which is licensed free of charge, as they might when working .\" professionally. .\" .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" %%%LICENSE_END .\" .\" References consulted: .\" Linux libc source code .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) .\" 386BSD man pages .\" Modified Sat Jul 24 17:48:42 1993 by Rik Faith (faith@cs.unc.edu) .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .\" .\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka .\" all rights reserved. .\" Translated 1997-12-24, HIROFUMI Nishizuka .\" Updated & Modified 2005-02-19, Yuichi SATO .\" Updated 2009-04-24, Akihiro MOTOKI , LDP v3.20 .\" Updated 2013-05-01, Akihiro MOTOKI .\" .TH TELLDIR 3 2013\-09\-02 "" "Linux Programmer's Manual" .SH 名前 telldir \- ディレクトリストリーム中の現在位置を返す .SH 書式 .nf \fB#include \fP .sp \fBlong telldir(DIR *\fP\fIdirp\fP\fB);\fP .fi .sp .in -4n glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp \fBtelldir\fP(): _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE .SH 説明 \fBtelldir\fP() 関数は、ディレクトリストリーム \fIdirp\fP に結びつけられた 現在位置を返す。 .SH 返り値 成功した場合、 \fBtelldir\fP() 関数はディレクトリストリーム中の現在位置を返す。 エラーの場合、\-1 が返されて、 \fIerrno\fP が適切に設定される。 .SH エラー .TP \fBEBADF\fP ディレクトリストリームディスクリプター \fIdirp\fP が無効である。 .SH 属性 .SS "マルチスレッディング (pthreads(7) 参照)" \fBtelldir\fP() 関数はスレッドセーフである。 .SH 準拠 4.3BSD, POSIX.1\-2001. .SH 注意 バージョン 2.1.1 以前の glibc では、 \fBtelldir\fP()9 の返り値の型は \fIoff_t\fP であった。 POSIX.1\-2001 では \fIlong\fP と規定されており、glibc 2.1.2 以降では \fIlong\fP になっている。 .\" https://lwn.net/Articles/544298/ 初期のファイルシステムでは、 \fBtelldir\fP() が返す値は単なるディレクトリ内のファイルオフセットであった。新しめのファイルシステムでは、ディレクトリを表現するのに、フラットなテーブルではなく、ツリーやハッシュ構造が使用されている。このようなファイルシステムでは、 \fBtelldir\fP() が返す値 (および \fBreaddir\fP(3) が内部で使用する値) は、ディレクトリ内での値を示すのにファイルシステム実装が使っている "cookie" となる。アプリケーションプログラムでは、必ずこの値を内容を意識せず単なる値として扱うべきであり、その内容について前提を持つべきでは「ない」。 .SH 関連項目 \fBclosedir\fP(3), \fBopendir\fP(3), \fBreaddir\fP(3), \fBrewinddir\fP(3), \fBscandir\fP(3), \fBseekdir\fP(3) .SH この文書について この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.79 の一部 である。プロジェクトの説明とバグ報告に関する情報は http://www.kernel.org/doc/man\-pages/ に書かれている。