PATHCONF(3-POSIX) RISC/os Reference Manual PATHCONF(3-POSIX)
NAME
pathconf, fpathconf - get configurable pathname variables
SYNOPSIS
#include <unistd.h>
long pathconf(path, name)
char *path;
int name;
long fpathconf(fildes, name)
int fildes, name;
DESCRIPTION
pathconf and fpathconf allow a program to determine the
current value of a configurable limit or variable that is
associated with a file or directory.
For pathconf, path points to the pathname of a file or
directory. For fpathconf, fildes is an open file descrip-
tor.
name represents the variable to be queried relative to the
indicated file or directory and can have the following
values:
name Variable
{PCLINKMAX} {LINKMAX}
{PCMAXCANON} {MAXCANON}
{PCMAXINPUT} {MAXINPUT}
{PCNAMEMAX} {NAMEMAX}
{PCPATHMAX} {PATHMAX}
{PCPIPEBUF} {PIPEBUF}
{PCCHOWNRESTRICTED} {POSIXCHOWNRESTRICTED}
{PCNOTRUNC} {POSIXNOTRUNC}
{PCVDISABLE} {POSIXVDISABLE}
The variables are defined in either <limits.h> or
<unistd.h>, and the symbolic constants that are the
corresponding values used for name, are defined in
<unistd.h>.
If name is {_PC_LINK_MAX} and path or fildes refers to a
directory, the value returned applies to the directory
itself.
If name is {_PC_MAX_CANON} or {_PC_MAX_INPUT}, path or
fildes must refer to a terminal file.
If name is {_PC_NAME_MAX} or {_PC_NO_TRUNC}, and path or
fildes refers to a directory, the value returned applies to
files within the directory.
Printed 1/15/91 Page 1
PATHCONF(3-POSIX) RISC/os Reference Manual PATHCONF(3-POSIX)
If name is {_PC_PIPE_BUF} and 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.
If name is {_PC_CHOWN_RESTRICTED}, and path or fildes refer
to a directory, the value returned applies to any files
other than directories that exist or can be created within
the directory.
RETURN VALUES
If name is an invalid value, pathconf or fpathconf returns
-1 and errno is set to indicate the error.
If the variable corresponding to name has no limit for the
path or file descriptor, pathconf or fpathconf return -1
without changing errno.
If name cannot be associated with the file specified by
path, or if the process does not have permission to query
the file specified by path, or path does not exist, pathconf
returns -1 and errno is set to indicate the error.
If name cannot be associated with the file specified by
fildes, or fildes is not a valid file descriptor, fpathconf
returns -1 and errno is set to indicate the error.
Otherwise, pathconf and fpathconf return the current value
of the variable for the file or directory. The value
returned will not be more restrictive than the corresponding
value when the program was compiled.
ERRORS
If any of the following conditions occur, pathconf returns
-1 and sets errno to the corresponding value:
[EINVAL] name is invalid.
[EACCES] Search permission is denied for a com-
ponent of the path prefix.
[EINVAL] The variable indicated by name cannot
be associated with the specified file.
[ENAMETOOLONG] The length of path 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 path
points to an empty string.
Page 2 Printed 1/15/91
PATHCONF(3-POSIX) RISC/os Reference Manual PATHCONF(3-POSIX)
[ENOTDIR] A component of the path prefix is not
a directory.
If any of the following conditions are detected, fpathconf
returns -1 and sets errno to the corresponding value:
[EBADF] fildes is not a valid file descriptor.
[EINVAL] The variable indicated by name cannot
be associated with the specified file.
Printed 1/15/91 Page 3