📄 fpathconf.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><!-- Copyright 1997 The Open Group, All Rights Reserved --><title>fpathconf</title></head><body bgcolor=white><center><font size=2>The Single UNIX ® Specification, Version 2<br>Copyright © 1997 The Open Group</font></center><hr size=2 noshade><h4><a name = "tag_000_005_176"> </a>NAME</h4><blockquote>fpathconf, pathconf - get configurable pathname variables</blockquote><h4><a name = "tag_000_005_177"> </a>SYNOPSIS</h4><blockquote><pre><code>#include <<a href="unistd.h.html">unistd.h</a>>long int fpathconf(int <i>fildes</i>, int <i>name</i>);long int pathconf(const char *<i>path</i>, int <i>name</i>);</code></pre></blockquote><h4><a name = "tag_000_005_178"> </a>DESCRIPTION</h4><blockquote>The<i>fpathconf()</i>and<i>pathconf()</i>functions provide a method for the application to determinethe current value of a configurable limit or option(<i>variable</i>)that is associated with a file or directory.<p>For<i>pathconf()</i>,the<i>path</i>argument points to the pathname of a file or directory.<p>For<i>fpathconf()</i>,the<i>fildes</i>argument is an open file descriptor.<p>The<i>name</i>argument represents the variable to be queriedrelative to that file or directory.Implementations will support all of the variables listed inthe following table and may support others.The variables in the following table come from<i><a href="limits.h.html"><limits.h></a></i>or<i><a href="unistd.h.html"><unistd.h></a></i>and the symbolic constants, defined in<i><a href="unistd.h.html"><unistd.h></a></i>,are the corresponding values used for<i>name:</i><p><table bordercolor=#000000 border=1 align=center><tr valign=top><th align=center><b>Variable</b><th align=center><b>Value of <i>name</i></b><th align=center><b>Notes</b><tr valign=top><td align=left>FILESIZEBITS<td align=left>_PC_FILESIZEBITS<td align=left>3,4<tr valign=top><td align=left>LINK_MAX<td align=left>_PC_LINK_MAX<td align=left>1<tr valign=top><td align=left>MAX_CANON<td align=left>_PC_MAX_CANON<td align=left>2<tr valign=top><td align=left>MAX_INPUT<td align=left>_PC_MAX_INPUT<td align=left>2<tr valign=top><td align=left>NAME_MAX<td align=left>_PC_NAME_MAX<td align=left>3,4<tr valign=top><td align=left>PATH_MAX<td align=left>_PC_PATH_MAX<td align=left>4,5<tr valign=top><td align=left>PIPE_BUF<td align=left>_PC_PIPE_BUF<td align=left>6<tr valign=top><td align=left>_POSIX_CHOWN_RESTRICTED<td align=left>_PC_CHOWN_RESTRICTED<td align=left>7<tr valign=top><td align=left>_POSIX_NO_TRUNC<td align=left>_PC_NO_TRUNC<td align=left>3,4<tr valign=top><td align=left>_POSIX_VDISABLE<td align=left>_PC_VDISABLE<td align=left>2<tr valign=top><td align=left>_POSIX_ASYNC_IO<td align=left>_PC_ASYNC_IO<td align=left>8<tr valign=top><td align=left>_POSIX_PRIO_IO<td align=left>_PC_PRIO_IO<td align=left>8<tr valign=top><td align=left>_POSIX_SYNC_IO<td align=left>_PC_SYNC_IO<td align=left>8</table><dl><dt><b>Notes:</b><dd><ol><p><li>If<i>path</i>or<i>fildes</i>refers to a directory, the value returned applies to the directory itself.<p><li>If<i>path</i>or<i>fildes</i>does not refer to a terminal file,it is unspecified whether animplementation supports an association of the variable name withthe specified file.<p><li>If<i>path</i>or<i>fildes</i>refers to a directory, the value returned applies tofilenames within the directory.<p><li>If<i>path</i>or<i>fildes</i>does not refer to a directory,it is unspecified whether animplementation supports an association of the variable name withthe specified file.<p><li>If<i>path</i>or<i>fildes</i>refers to a directory, the value returned is the maximum length ofa relative pathname when the specified directory is theworking directory.<p><li>If<i>path</i>refers to a FIFO, or<i>fildes</i>refers to a pipe or FIFO, the value returned applies to the referencedobject. If<i>path</i>or<i>fildes</i>refers to a directory, the value returned applies to any FIFO that exists orcan be created within the directory. If<i>path</i>or<i>fildes</i>refers to any other type of file, it is unspecified whether an implementationsupports an association of the variable name with the specified file.<p><li>If<i>path</i>or<i>fildes</i>refers to a directory, the value returned applies to any files, other thandirectories, that exist or can be created within the directory.<p><li>If <i>path</i>or<i>fildes</i>refers to a directory, it is unspecified whether an implementationsupports an association of the variable name with the specified file.<p></ol></dl></blockquote><h4><a name = "tag_000_005_179"> </a>RETURN VALUE</h4><blockquote>If<i>name</i>is an invalid value, both<i>pathconf()</i>and<i>fpathconf()</i>return -1 and<i>errno</i>is set to indicate the error.<p>If the variable corresponding to<i>name</i>has no limit for the<i>path</i>or file descriptor, both<i>pathconf()</i>and<i>fpathconf()</i>return -1 without changing<i>errno</i>.If the implementation needs to use<i>path</i>to determine the value of<i>name</i>and the implementation does not support theassociation of<i>name</i>with the file specified by<i>path</i>,or if the process did not have appropriate privileges to query thefile specified by<i>path</i>,or<i>path</i>does not exist,<i>pathconf()</i>returns -1 and<i>errno</i>is set to indicate the error.<p>If the implementation needs to use<i>fildes</i>to determine the value of<i>name</i>and the implementation does not support theassociation of<i>name</i>with the file specified by<i>fildes</i>,or if<i>fildes</i>is an invalid file descriptor,<i>fpathconf()</i>will return -1 and<i>errno</i>is set to indicate the error.<p>Otherwise<i>pathconf()</i>or<i>fpathconf()</i>returns the current variable value for the file or directory without changing<i>errno</i>.The value returned will not be more restrictive than thecorresponding value available to the application when itwas compiled with the implementation's<i><a href="limits.h.html"><limits.h></a></i>or<i><a href="unistd.h.html"><unistd.h></a></i>.</blockquote><h4><a name = "tag_000_005_180"> </a>ERRORS</h4><blockquote>The<i>pathconf()</i>function will fail if:<dl compact><dt>[EINVAL]<dd>The value of<i>name</i>is not valid.<dt>[ELOOP]<dd>Too many symbolic links were encountered in resolving <i>path</i>.</dl><p>The<i>pathconf()</i>function may fail if:<dl compact><dt>[EACCES]<dd>Search permission is denied for a component of the path prefix.<dt>[EINVAL]<dd>The implementation does not support an association of the variable<i>name</i>with the specified file.<dt>[ENAMETOOLONG]<dd>The length of the<i>path</i>argument exceeds {PATH_MAX}or a pathname component is longer than {NAME_MAX}.<dt>[ENAMETOOLONG]<dd>Pathname resolution of a symbolic link produced an intermediate result whoselength exceeds {PATH_MAX}.<dt>[ENOENT]<dd>A component of <i>path</i> does not name an existing fileor <i>path</i> is an empty string.<dt>[ENOTDIR]<dd>A component of the path prefix is not a directory.</dl><p>The<i>fpathconf()</i>function will fail if:<dl compact><dt>[EINVAL]<dd>The value of<i>name</i>is not valid.</dl><p>The<i>fpathconf()</i>function may fail if:<dl compact><dt>[EBADF]<dd>The<i>fildes</i>argument is not a valid file descriptor.<dt>[EINVAL]<dd>The implementation does not support an association of the variable<i>name</i>with the specified file.</dl></blockquote><h4><a name = "tag_000_005_181"> </a>EXAMPLES</h4><blockquote>None.</blockquote><h4><a name = "tag_000_005_182"> </a>APPLICATION USAGE</h4><blockquote>None.</blockquote><h4><a name = "tag_000_005_183"> </a>FUTURE DIRECTIONS</h4><blockquote>None.</blockquote><h4><a name = "tag_000_005_184"> </a>SEE ALSO</h4><blockquote><i><a href="confstr.html">confstr()</a></i>,<i><a href="sysconf.html">sysconf()</a></i>,<i><a href="limits.h.html"><limits.h></a></i>,<i><a href="unistd.h.html"><unistd.h></a></i>,the <b>XCU</b> specification of <i><a href="../xcu/getconf.html">getconf</a></i>.</blockquote><h4>DERIVATION</h4><blockquote>Derived from the POSIX.1-1988 standard.</blockquote><hr size=2 noshade><center><font size=2>UNIX ® is a registered Trademark of The Open Group.<br>Copyright © 1997 The Open Group<br> [ <a href="../index.html">Main Index</a> | <a href="../xshix.html">XSH</a> | <a href="../xcuix.html">XCU</a> | <a href="../xbdix.html">XBD</a> | <a href="../cursesix.html">XCURSES</a> | <a href="../xnsix.html">XNS</a> ]</font></center><hr size=2 noshade></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -