pathconf(2) DG/UX 4.30 pathconf(2)
NAME
pathconf, fpathconf - Get configurable pathname variables.
FUNCTIONS
pathconf(), fpathconf()
SYNOPSIS
#include <unistd.h>
long pathconf (path, name)
char *path;
int name;
long 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
configurable 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. The implementation
shall support all of the variables listed in the table
"Configurable Pathname Variables" and may support others.
The variables in the table come from <limits.h> or
<unistd.h> and the symbolic constants, defined in
<unistd.h>, that are the corresponding values used for name.
Configurable Pathname Variables
Variable name Value Notes
{LINK_MAX} {_PC_LINK_MAX} 1
{MAX_CANON} {_PC_MAX_CANON} 2
{MAX_INPUT} {_PC_MAX_INPUT} 2
{NAME_MAX} {_PC_NAME_MAX} 3, 4
{PATH_MAX} {_PC_PATH_MAX} 4, 5
{PIPE_BUF} {_PC_PIPE_BUF} 6
{_POSIX_CHOWN_RESTRICTED} {_PC_CHOWN_RESTRICTED} 7
{_POSIX_NO_TRUNC} {_PC_NO_TRUNC} 3, 4
{_POSIX_VDISABLE} {_PC_VDISABLE} 2
The following Notes apply to the entries in the table:
1. If path or fildes refers to a directory, the value
Licensed material--property of copyright holder(s) Page 1
pathconf(2) DG/UX 4.30 pathconf(2)
returned applies to the directory itself.
2. 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 filenames within the directory.
4. The behavior is undefined if path or fildes does not
refer to a directory.
5. If 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 filedes 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
path or fildes refer to any other type of file, the
behavior is undefined.
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.
RETURNS
If name is an invalid value, the pathconf() and fpathconf()
functions shall return -1.
If the variable corresponding to name has no limit for the
path or file descriptor, the pathconf() and fpathconf()
functions shall return -1 without changing errno.
If the implementation needs to use path to determine the
value of name and the implementation does not support the
association of name with the file specified by path, or if
the process did not have the appropriate privileges to query
the file specified by path, or path does not exist, the
pathconf() function shall return -1.
If the implementation needs to use fildes to determine the
value of name and the implementation does not support the
association of name with the file specified by fildes, or if
fildes is an invalid file descriptor, the fpathconf()
function shall return -1.
Otherwise, the pathconf() and fpathconf() functions return
the current variable value for the file or directory without
changing errno. The value returned shall not be more
Licensed material--property of copyright holder(s) Page 2
pathconf(2) DG/UX 4.30 pathconf(2)
restrictive than the corresponding value described to the
application when it was compiled with the implementation's
<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 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 implementation does not support an association of
the variable name with the specified file.
[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.
[EINVAL]
The implementation does not support an association of
the variable name with the specified file.
COPYRIGHTS
Portions of this text are reprinted from IEEE Std 1003.1-
1988, Portable Operating System Interface for Computer
Environment, copyright © 1988 by the Institute of Electrical
and Electronics Engineers, Inc., with the permission of the
Licensed material--property of copyright holder(s) Page 3
pathconf(2) DG/UX 4.30 pathconf(2)
IEEE Standards Department. To purchase IEEE Standards, call
800/678-IEEE.
In the event of a discrepancy between the electronic and the
original printed version, the original version takes
precedence.
STANDARDS
In addition to the configurable pathname variables listed
above, the following variables are defined in
<sys/m88kbcs.h>:
_PC_BLKSIZE:
get optimum block size (in bytes) for I/O operations on
the file, or 0 if such information is not available.
Licensed material--property of copyright holder(s) Page 4