pathconf(2) pathconf(2)
NAME
pathconf, fpathconf - Get configurable pathname variables.
SYNOPSIS
#include <unistd.h>
long pathconf (path, name)
char *path;
int name;
int fpathconf (fildes, name)
int fildes, name;
DESCRIPTION
The pathconf() and fpathconf() functions provide a method
for the application to determine the current value of a con-
figurable limit or option (variable) that is associated with
a file or directory.
For pathconf(), the path argument points to the pathname of
a file or directory. For fpathconf(), the fildes argument
is an open file descriptor.
The name argument represents the variable to be queried
relative to that file or directory. All of the variables
listed in the table "Configurable Pathname Values" are sup-
ported. The variables in the table not prefixed with _POSIX
are defined internally and not in any header files. The
symbolic constants, defined in <unistd.h>, are the
corresponding values used for name.
Configurable Pathname Values
Variable name Value Notes
{LINKMAX} {PCLINKMAX} 1
{MAXCANON} {PCMAXCANON} 2
{MAXINPUT} {PCMAXINPUT} 2
{NAMEMAX} {PCNAMEMAX} 3,4
{PATHMAX} {PCPATHMAX} 4,5
{PIPEBUF} {PCPIPEBUF} 6
{POSIXCHOWNRESTRICTED} {PCCHOWNRESTRICTED} 7
{POSIXNOTRUNC} {PCNOTRUNC} 3,4
{POSIXVDISABLE} {PCVDISABLE} 2
{BLKSIZE} {PCBLKSIZE} 8
{SYNCIO} {PCSYNCIO} 9
The following notes apply to the entries in the table above:
1. If path or fildes refers to a directory, the value
returned applies to the directory itself.
2. Applies only to terminal files. EINVAL is returned
Page 1 CX/UX Programmer's Reference Manual
pathconf(2) pathconf(2)
otherwise.
3. Path or fildes refers to a directory. The value
returned applies to the filenames within the directory.
4. EINVAL is returned if path or fildes does not refer to
a directory.
5. Path or fildes refers to a directory. The value
returned is the maximum length of a relative pathname when
the specified directory is the working directory.
6. If path refers to a FIFO, or fildes refers to a pipe
or FIFO, the value returned applies to the referenced
object 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. EINVAL is returned if
path or fildes refers to any other type of file.
Page 2 CX/UX Programmer's Reference Manual
pathconf(2) pathconf(2)
7. If path or fildes refer to a directory, the value
returned applies to any files defined in this standard,
other than directories, that exist or can be created
within the directory.
8. The value returned is the optimum block size in bytes
for I/O operations on the file, or 0 if such information
is not available.
9. Applies only to regular disk files. EINVAL is
returned otherwise.
RETURN VALUE
The pathconf() and fpathconf() functions return the current
variable value for the file or directory without changing
errno. The value returned will not be more restrictive than
the corresponding value described to the application when it
was compiled with <limits.h> or <unistd.h>.
ERRORS
If any of the following conditions occur, the pathconf() and
fpathconf() functions shall return -1 and set errno to the
corresponding value:
[EINVAL] The value of the name is invalid.
For each of the following conditions, if the condition is
detected, the pathconf() function shall return -1 and set
errno to the corresponding value:
[EACCES] Search permission is denied for a component
of the path prefix.
[EINVAL] The association of the variable name with the
specified file is not supported (see notes
above).
[ENAMETOOLONG] The length of the path argument exceeds
PATH_MAX, or a pathname component is longer
than NAME_MAX while _POSIX_NO_TRUNC is in
effect.
[ENOENT] The named file does not exist or the path
argument points to an empty string.
[ENOTDIR] A component of the path prefix is not a
directory.
For each of the following conditions, if the condition is
detected, the fpathconf() function shall return -1 and set
errno to the corresponding value:
[EBADF] The fildes argument is not a valid file
descriptor.
Page 3 CX/UX Programmer's Reference Manual
pathconf(2) pathconf(2)
[EINVAL] The association of the variable name with the
specified value is not supported (see notes
above).
Page 4 CX/UX Programmer's Reference Manual