| PATHCONF(2) | System Calls Manual | PATHCONF(2) |
pathconf, fpathconf —
#include <unistd.h>
long
pathconf(const
char *path, int
name);
long
fpathconf(int
fd, int name);
pathconf() and fpathconf()
functions provide a method for applications to determine the current value of
a configurable system limit or option variable associated with a pathname or
file descriptor.
For pathconf, the
path argument is the name of a file or directory. For
fpathconf, the fd argument is
an open file descriptor. The name argument specifies
the system variable to be queried. Symbolic constants for each name value
are found in the <unistd.h>
header.
The available values are as follows:
_PC_LINK_MAX_PC_MAX_CANON_PC_MAX_INPUT_PC_NAME_MAX_PC_PATH_MAX_PC_PIPE_BUF_PC_CHOWN_RESTRICTED_PC_NO_TRUNCNAME_MAX} are
silently truncated, or non-zero if an error is generated when
{NAME_MAX} is exceeded._PC_VDISABLE_PC_SYNC_IO_PC_FILESIZEBITSmaxsize, then the returned value is 2 plus the
floor of the base 2 logarithm of maxsize._PC_SYMLINK_MAX_PC_2_SYMLINKS{_PC_2_SYMLINKS} is undefined.pathconf or
fpathconf is not successful, -1 is returned and
errno is set appropriately. Otherwise, if the variable
is associated with functionality that does not have a limit in the system, -1
is returned and errno is not modified. Otherwise, the
current variable value is returned.
pathconf
and fpathconf functions shall return -1 and set
errno to the corresponding value.
EINVAL]pathconf() will fail if:
EACCES]EIO]ELOOP]ENAMETOOLONG]NAME_MAX}
characters, or an entire path name exceeded
{PATH_MAX} characters.ENOENT]ENOTDIR]fpathconf() will fail if:
pathconf() and fpathconf()
functions conform to IEEE Std 1003.1-1990
(“POSIX.1”).
pathconf and fpathconf
functions first appeared in 4.4BSD.
| July 26, 2010 | NetBSD 9.0 |