|
|
#include <unistd.h>long pathconf (path, name) char *path; int name;
long fpathconf (fildes, name) int fildes, name;
fpathconf- determines current value of an open file descriptor
The pathconf and fpathconf functions provide a method for an application to determine the current value of a configurable limit or option (variable) associated with a file or directory.
For pathconf, the path argument points to the pathname of a file or directory. For fpathconf, the fildes the argument is an open file descriptor.
The name argument represents the variable to be queried relative to the file or directory. The implementation supports all of the variables listed in the following table and may support others. The variables in the following table come from <limits.h> or <unistd.h> and the symbolic constants, defined in <unistd.h>, that are the corresponding values used for name.
Variable | name Value | Notes |
---|---|---|
{LINK_MAX} | {_PC_LINK_MAX} | 1 |
{MAX_CANON} | {_PC_MAX_CANON} | 2 |
{MAX_INPUT} | {_PC_MAX_INPUT} | 2 |
{NAME_MAX} | {_PC_NAME_MAX} | 3,4 |
{PATH_MAX} | {_PC_PATH_MAX} | 4,5 |
{PIPE_BUF} | {_PC_PIPE_BUF} | 6 |
{_POSIX_CHOWN_RESTRICTED} | {_PC_CHOWN_RESTRICTED} | 7 |
{_POSIX_NO_TRUNC} | {_PC_NO_TRUNC} | 3,4 |
{_POSIX_VDISABLE} | {_PC_VDISABLE} | 2 |
Note that:
If the variable corresponding to name has no limit for the path or file descriptor, the pathconf and fpathconf functions return a -1 without changing errno.
If the implementation needs to use path to determine the value of name and the implementation does not support the association of name with the file specified by path, or if the process did not have the appropriate priveleges to query the file specified by path, or path does not exist, the pathconf function returns -1.
If the implementation needs to use fildes to determine the value of name and the implementation does not support the association of name with the file specified by fildes, or if fildes is an invalid descriptor, the fpathcon function returns -1.
Otherwise, the
pathconf
and
fpathconf
functions return the current variable
value for the file or directory without changing
errno.
The value returned is not more restrictive than the
corresponding value described to the application when it
was compiled with the implementation's
<limits.h>
or
<unistd.h>.
If any of the following conditions occur, the pathconf and fpathcon functions return -1 and set errno to the corresponding value:
For each of the following conditions, if the condition is detected, the pathconf function returns a -1 and set errno to the following value:
For each of the following conditions, if the condition is detected, the fpathconf function returns a -1 and set errno to the corresponding value:
IEEE POSIX Std 1003.1-1990 System Application Program Interface (API) [C Language] (ISO/IEC 9945-1)
;
and
NIST FIPS 151-1
.