pathconf.2 (2010 09)
p
pathconf(2) pathconf(2)
NAME
pathconf( ), fpathconf( ) - get configurable path name variables
SYNOPSIS
#include <unistd.h>
long pathconf(const char *path, int name);
long fpathconf(int fildes, int name);
DESCRIPTION
The pathconf() and fpathconf() functions provide a method for applications to determine the
value of a configurable limit or option associated with a file or directory (see limits (5) and
<unistd.h>).
For
pathconf(), the path argument points to the path name of a file or directory.
For
fpathconf(), the fildes argument is an open file descriptor.
For both functions, the name argument represents the variable to be queried regarding the file or direc-
tory to which the other argument refers.
The following table lists the configuration variables available from
pathconf() and fpathconf(),
and lists for each variable the associated value of the name argument:
Variable Value of name Notes
LINK_MAX _PC_LINK_MAX 1
MAX_CANON _PC_MAX_CANON 2
MAX_INPUT _PC_MAX_INPUT 2
_PC_FILESIZEBITS 3, 4, 10
NAME_MAX _PC_NAME_MAX 3, 4
PATH_MAX _PC_PATH_MAX 4, 5
PIPE_BUF _PC_PIPE_BUF 6
_POSIX_ASYNC_IO _PC_ASYNC_IO 1, 11
_POSIX_CHOWN_RESTRICTED _PC_CHOWN_RESTRICTED 7, 8
_POSIX_NO_TRUNC _PC_NO_TRUNC 3, 4
_POSIX_PRIO_IO _PC_PRIO_IO 1, 12
_POSIX_SYNC_IO _PC_SYNC_IO 9
_POSIX_VDISABLE _PC_V_DISABLE 2
The variables in the table are defined as constants in <limits.h> or <unistd.h> if they do not vary
from one path name to another. The associated values of the name argument are defined in
<unistd.h>.
RETURN VALUE
The following notes further qualify the table above.
1. If path or fildes refers to a directory, the value returned applies to the directory itself.
2. If the variable is constant, the value returned is identical to the variable’s definition in
<limits.h> or <unistd.h> regardless of the type of fildes or path . The behavior is
undefined if path or fildes does not refer to a terminal file.
3. If path or fildes refers to a directory, the value returned applies to the file names within the
directory.
4. If path or fildes does not refer to a directory,
pathconf() or fpathconf() returns −1 and
sets errno to [EINVAL].
5. If path or fildes refers to a directory, the value returned is the maximum length of a relative
path name when the specified directory is the working directory.
6. If path refers to a FIFO, or if fildes refers to a pipe or FIFO, the value returned applies to the
pipe or FIFO itself. If path or fildes refers to a directory, the value returned applies to any
FIFOs that exist or can be created within the directory. If
PIPE_BUF is a constant, the value
returned is identical to the definition of PIPE_BUF in <limits.h> regardless of the type of
fildes or path . The behavior is undefined for a file other than a directory, FIFO, or pipe.
7. If path or fildes refers to a directory, the value returned applies to files of any type, other than
directories, that exist or can be created within the directory.
HP-UX 11i Version 3: September 2010 − 1 − Hewlett-Packard Company 1