Man page - fpathconf(3)

Packages contains this manual

Available languages:

en fr es pl ja ru ro

Manual

FPATHCONF

名 前
書 式
説 明
返 り 値
エ ラ ー
属 性
準 拠
注 意
関 連 項 目
こ の 文 書 に つ い て

名 前

fpathconf, pathconf - フ ァ イ ル の 設 定 値 を 取 得 す る

書 式

#include <unistd.h>

long fpathconf(int fd , int name );
long pathconf(const char *
path , int name );

説 明

fpathconf () は オ ー プ ン さ れ て い る フ ァ イ ル デ ィ ス ク リ プ タ ー fd に 対 し て 設 定 さ れ て い る オ プ シ ョ ン name の 値 を 取 得 す る 。

pathconf () は フ ァ イ ル 名 path に 対 し て 設 定 さ れ て い る オ プ シ ョ ン name の 値 を 取 得 す る 。

対 応 す る マ ク ロ の う ち <unistd.h> で 定 義 さ れ て い る も の は 最 小 値 で あ る 。 ア プ リ ケ ー シ ョ ン に よ っ て は こ れ ら の 値 を 変 更 し て よ り 有 利 な 動 作 を 行 お う と す る も の が あ る 。 こ の 場 合 で も fpathconf () ま た は pathconf () は 呼 び 出 す こ と が で き る 。 こ の 場 合 は よ り 大 き な 値 が 返 る こ と に な ろ う 。

name を 以 下 の 定 数 の ど れ か に す る と 、 対 応 す る 設 定 オ プ シ ョ ン が 返 さ れ る 。
_PC_LINK_MAX

フ ァ イ ル へ の リ ン ク の 最 大 数 。 fd ま た は path が デ ィ レ ク ト リ の 場 合 は 、 こ の 値 は デ ィ レ ク ト リ 全 体 に 適 用 さ れ る 。 対 応 す る マ ク ロ は _POSIX_LINK_MAX で あ る 。

_PC_MAX_CANON

フ ォ ー マ ッ ト 付 き 入 力 行 の 最 大 長 。 こ の と き fd ま た は path は 端 末 を 参 照 し て い な け れ ば な ら な い 。 対 応 す る マ ク ロ は _POSIX_MAX_CANON で あ る 。

_PC_MAX_INPUT

入 力 行 の 最 大 長 。 こ の と き fd ま た は path は 端 末 を 参 照 し て い な け れ ば な ら な い 。 対 応 す る マ ク ロ は _POSIX_MAX_INPUT で あ る 。

_PC_NAME_MAX

デ ィ レ ク ト リ path ま た は fd 内 に 、 そ の プ ロ セ ス が 作 成 す る こ と が で き る フ ァ イ ル 名 の 最 大 長 。 対 応 す る マ ク ロ は _POSIX_NAME_MAX で あ る 。

_PC_PATH_MAX

path ま た は fd が カ レ ン ト デ ィ レ ク ト リ の 場 合 、 相 対 パ ス 名 の 最 大 長 。 対 応 す る マ ク ロ は _POSIX_PATH_MAX で あ る 。

_PC_PIPE_BUF

The maximum number of bytes that can be written atomically to a pipe of FIFO. For fpathconf (), fd should refer to a pipe or FIFO. For fpathconf (), path 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 _POSIX_PIPE_BUF .

_PC_CHOWN_RESTRICTED

This returns a positive value if the use of chown (2) and fchown (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 _POSIX_CHOWN_RESTRICTED .

If fd or path refers to a directory, then the return value applies to all files in that directory.

_PC_NO_TRUNC

ア ク セ ス 中 の フ ァ イ ル 名 が _POSIX_NAME_MAX よ り も 長 く 、 エ ラ ー と な る 場 合 に は 0 以 外 の 値 を 返 す 。 対 応 す る マ ク ロ は _POSIX_NAME_MAX で あ る 。

_PC_VDISABLE

特 殊 文 字 (special character) の 処 理 が 許 さ れ て い な い 場 合 は 0 以 外 の 値 を 返 す 。 こ の と き fd ま た は path は 端 末 を 参 照 し て い な け れ ば な ら な い 。

返 り 値

The return value of these functions is one of the following:

*

On error, -1 is returned and errno is set to indicate the cause of the error (for example, EINVAL , indicating that name is invalid).

*

If name corresponds to a maximum or minimum limit, and that limit is indeterminate, -1 is returned and errno is not changed. (To distinguish an indeterminate limit from an error, set errno to zero before the call, and then check whether errno is nonzero when -1 is returned.)

*

If name corresponds to an option, a positive value is returned if the option is supported, and -1 is returned if the option is not supported.

*

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 <unistd.h> or <limits.h> when the application was compiled.

エ ラ ー

EACCES

( pathconf ()) Search permission is denied for one of the directories in the path prefix of path .

EBADF

( fpathconf ()) fd が 適 切 な フ ァ イ ル デ ィ ス ク リ プ タ ー で な い 。

EINVAL

name が 無 効 で あ る 。

EINVAL

The implementation does not support an association of name with the specified file.

ELOOP

( pathconf ()) path を 解 決 す る 際 に 遭 遇 し た シ ン ボ リ ッ ク リ ン ク が 多 過 ぎ る 。

ENAMETOOLONG

( pathconf ()) path が 長 過 ぎ る 。

ENOENT

( pathconf ()) A component of path does not exist, or path is an empty string.

ENOTDIR

( pathconf ()) path の デ ィ レ ク ト リ 部 分 が 実 際 に は デ ィ レ ク ト リ で な い 。

属 性

こ の 節 で 使 用 さ れ て い る 用 語 の 説 明 に つ い て は 、 attributes (7) を 参 照 。

Image grohtml-40525-1.png

準 拠

POSIX.1-2001, POSIX.1-2008.

注 意

name _PC_NAME_MAX を 入 れ て 返 さ れ た 値 よ り も 長 い フ ァ イ ル 名 を 持 つ フ ァ イ ル が 、 与 え ら れ た デ ィ レ ク ト リ に 存 在 す る か も し れ な い 。

い く つ か の 返 り 値 は と て も 大 き く な る こ と が あ る 。 こ れ ら を 使 っ て メ モ リ ー の 割 り 当 て を 行 う の は 適 当 で は な い 。

関 連 項 目

getconf (1), open (2), statfs (2), confstr (3), sysconf (3)

こ の 文 書 に つ い て

こ の man ペ ー ジ は Linux man-pages プ ロ ジ ェ ク ト の リ リ ー ス 5.10 の 一 部 で あ る 。 プ ロ ジ ェ ク ト の 説 明 と バ グ 報 告 に 関 す る 情 報 は https://www.kernel.org/doc/man-pages/ に 書 か れ て い る 。