.\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de) .\" and Copyright (C) 2017 Michael Kerrisk .\" .\" %%%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 .\" .\" Modified Wed Jul 28 11:12:26 1993 by Rik Faith (faith@cs.unc.edu) .\" .\" FIXME Probably all of the following should be documented: .\" _PC_SYNC_IO, .\" _PC_ASYNC_IO, .\" _PC_PRIO_IO, .\" _PC_SOCK_MAXBUF, .\" _PC_FILESIZEBITS, .\" _PC_REC_INCR_XFER_SIZE, .\" _PC_REC_MAX_XFER_SIZE, .\" _PC_REC_MIN_XFER_SIZE, .\" _PC_REC_XFER_ALIGN, .\" _PC_ALLOC_SIZE_MIN, .\" _PC_SYMLINK_MAX, .\" _PC_2_SYMLINKS .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .\" .\" Japanese Version Copyright (c) 1998 NAKANO Takeo all rights reserved. .\" Translated Fri Mar 20 1998 by NAKANO Takeo .\" .TH FPATHCONF 3 " 2017\-07\-13" GNU "Linux Programmer's Manual" .SH 名前 fpathconf, pathconf \- ファイルの設定値を取得する .SH 書式 .nf \fB#include \fP .PP \fBlong fpathconf(int \fP\fIfd\fP\fB, int \fP\fIname\fP\fB);\fP \fBlong pathconf(const char *\fP\fIpath\fP\fB, int \fP\fIname\fP\fB);\fP .fi .SH 説明 \fBfpathconf\fP() はオープンされているファイルディスクリプター \fIfd\fP に対して設定されているオプション \fIname\fP の値を取得する。 .PP \fBpathconf\fP() はファイル名 \fIpath\fP に対して設定されているオプション \fIname\fP の値を取得する。 .PP 対応するマクロのうち \fI\fP で定義されているものは最小値である。アプリケーションによってはこれらの 値を変更してより有利な動作を行おうとするものがある。この場合でも \fBfpathconf\fP() または \fBpathconf\fP() は呼び出すことができる。この場合はより大きな値が返ることになろう。 .PP \fIname\fP を以下の定数のどれかにすると、対応する設定オプションが返される。 .TP \fB_PC_LINK_MAX\fP ファイルへのリンクの最大数。 \fIfd\fP または \fIpath\fP がディレクトリの場合は、この値はディレクトリ全体に適用される。対応する マクロは \fB_POSIX_LINK_MAX\fP である。 .TP \fB_PC_MAX_CANON\fP フォーマット付き入力行の最大長。このとき \fIfd\fP または \fIpath\fP は端末を参照していなければならない。 対応するマクロは \fB_POSIX_MAX_CANON\fP である。 .TP \fB_PC_MAX_INPUT\fP 入力行の最大長。このとき \fIfd\fP または \fIpath\fP は端末を参照していなければならない。 対応するマクロは \fB_POSIX_MAX_INPUT\fP である。 .TP \fB_PC_NAME_MAX\fP ディレクトリ \fIpath\fP または \fIfd\fP 内に、そのプロセスが作成することができるファイル名の最大長。 対応するマクロは \fB_POSIX_NAME_MAX\fP である。 .TP \fB_PC_PATH_MAX\fP \fIpath\fP または \fIfd\fP がカレントディレクトリの場合、相対パス名の最大長。 対応するマクロは \fB_POSIX_PATH_MAX\fP である。 .TP \fB_PC_PIPE_BUF\fP The maximum number of bytes that can be written atomically to a pipe of FIFO. For \fBfpathconf\fP(), \fIfd\fP should refer to a pipe or FIFO. For \fBfpathconf\fP(), \fIpath\fP should refer to a FIFO or a directory; in the latter case, the returned value corresponds to FIFOs created in that directory. The corresponding macro is \fB_POSIX_PIPE_BUF\fP. .TP \fB_PC_CHOWN_RESTRICTED\fP This returns a positive value if the use of \fBchown\fP(2) and \fBfchown\fP(2) for changing a file's user ID is restricted to a process with appropriate privileges, and changing a file's group ID to a value other than the process's effective group ID or one of its supplementary group IDs is restricted to a process with appropriate privileges. According to POSIX.1, this variable shall always be defined with a value other than \-1. The corresponding macro is \fB_POSIX_CHOWN_RESTRICTED\fP. .IP If \fIfd\fP or \fIpath\fP refers to a directory, then the return value applies to all files in that directory. .TP \fB_PC_NO_TRUNC\fP アクセス中のファイル名が \fB_POSIX_NAME_MAX\fP よりも長く、エラーとなる場合には 0 以外の値を返す。 対応するマクロは \fB_POSIX_NAME_MAX\fP である。 .TP \fB_PC_VDISABLE\fP 特殊文字 (special character) の処理が許されていない場合は 0 以外の値を 返す。このとき \fIfd\fP または \fIpath\fP は端末を参照していなければならない。 .SH 返り値 The return value of these functions is one of the following: .IP * 3 On error, \-1 is returned and \fIerrno\fP is set to indicate the cause of the error (for example, \fBEINVAL\fP, indicating that \fIname\fP is invalid). .IP * If \fIname\fP corresponds to a maximum or minimum limit, and that limit is indeterminate, \-1 is returned and \fIerrno\fP is not changed. (To distinguish an indeterminate limit from an error, set \fIerrno\fP to zero before the call, and then check whether \fIerrno\fP is nonzero when \-1 is returned.) .IP * If \fIname\fP corresponds to an option, a positive value is returned if the option is supported, and \-1 is returned if the option is not supported. .IP * Otherwise, the current value of the option or limit is returned. This value will not be more restrictive than the corresponding value that was described to the application in \fI\fP or \fI\fP when the application was compiled. .SH エラー .TP \fBEACCES\fP (\fBpathconf\fP()) Search permission is denied for one of the directories in the path prefix of \fIpath\fP. .TP \fBEBADF\fP (\fBfpathconf\fP()) \fIfd\fP が適切なファイルディスクリプターでない。 .TP \fBEINVAL\fP \fIname\fP が無効である。 .TP \fBEINVAL\fP The implementation does not support an association of \fIname\fP with the specified file. .TP \fBELOOP\fP (\fBpathconf\fP()) \fIpath\fP を解決する際に遭遇したシンボリックリンクが多過ぎる。 .TP \fBENAMETOOLONG\fP (\fBpathconf\fP()) \fIpath\fP が長過ぎる。 .TP \fBENOENT\fP (\fBpathconf\fP()) A component of \fIpath\fP does not exist, or \fIpath\fP is an empty string. .TP \fBENOTDIR\fP (\fBpathconf\fP()) \fIpath\fP のディレクトリ部分が実際にはディレクトリでない。 .SH 属性 この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。 .TS allbox; lbw23 lb lb l l l. インターフェース 属性 値 T{ \fBfpathconf\fP(), \fBpathconf\fP() T} Thread safety MT\-Safe .TE .SH 準拠 POSIX.1\-2001, POSIX.1\-2008. .SH 注意 \fIname\fP に \fB_PC_NAME_MAX\fP を入れて返された値よりも長いファイル名を持つファイルが、与えられたディ レクトリに存在するかもしれない。 .PP いくつかの返り値はとても大きくなることがある。これらを使って メモリーの割り当てを行うのは適当ではない。 .SH 関連項目 \fBgetconf\fP(1), \fBopen\fP(2), \fBstatfs\fP(2), \fBconfstr\fP(3), \fBsysconf\fP(3) .SH この文書について この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は \%https://www.kernel.org/doc/man\-pages/ に書かれている。