pathconf(3)pathconf(3)Name
pathconf, fpathconf - get configurable pathname variables (POSIX)
Syntax
#include <unistd.h>
long pathconf(path, name)
char *path;
int name;
long fpathconf(fildes, name)
int fildes, name;
Description
The and functions provide a method for the application to determine the
current value of a configurable limit or option that is associated with
a file or directory.
For the path argument points to the pathname of a file or directory.
For the fildes argument is an open file descriptor.
The name argument represents the variable to be queried relative to
that file or directory. The following table lists the variables which
may be queried and the corresponding value for the name argument. The
values for the name argument are defined in the <unistd.h> header file.
Variable name Value
LINK_MAX _PC_LINK_MAX
MAX_CANON _PC_MAX_CANON
MAX_INPUT _PC_MAX_INPUT
NAME_MAX _PC_NAME_MAX
PATH_MAX _PC_PATH_MAX
PIPE_BUF _PC_PIPE_BUF
_POSIX_CHOWN_RESTRICTED _PC_CHOWN_RESTRICTED
_POSIX_NO_TRUNC _PC_NO_TRUNC
_POSIX_VDISABLE _PC_VDISABLE
Return Values
Upon successful completion, the and functions return the current vari‐
able value for the file or directory.
If name is an invalid value, and return -1 and errno is set to indicate
the reason. If the variable corresponding to name is not defined on the
system, and return -1 without changing the value of errno.
Diagnostics
The and functions fail if the following occurs:
[EINVAL] The value of the name argument is invalid.
See Also
<unistd.h>
pathconf(3)