PATHCONF(2P) PATHCONF(2P)
NAME
pathconf, fpathconf - get configurable pathname variables
SYNOPSIS
#include <unistd.h>
long pathconf(path,name)
char *path;
int name;
long fpathconf(fields,name)
int fields, name;
DESCRIPTION
pathconf and fpathconf provide a method for an application
to determine the current value of a configurable limit or
option that is associated with a file or directory.
For fpathconf, path points to a pathname of a file or
directory. For fpathconf, fields is an open file
descriptor. name is the variable to be queried relative to
the file or directory. The following variables can be
queried:
_PC_LINK_MAX
_PC_MAX_CANON
_PC_MAX_INPUT
_PC_NAME_MAX
_PC_PATH_MAX
_PC_PIPE_BUF
_PC_CHOWN_RESTRICTED
_PC_NO_TRUNC
_PC_BLKSIZE
_PC_VDISABLE
RETURN VALUE
If name is not a valid variable name, or if the variable
cannot be associated with the specified file or directory,
or if the process does not have permission to query the file
specified by path, or path does not exist, pathconf will
return -1, and errno will be set to indicate the error. If
Page 1 May 1989
PATHCONF(2P) PATHCONF(2P)
the named variable is not defined on the system, a value of
-1 will be returned and errno sill remain unchanged.
Otherwise, pathconf and fpathconf will return the current
value associated with the variable for the file or
directory.
ERRORS
pathconf and fpathconf will fail if one or more of the
following are true:
[ENOTDIR] A component of the path prefix is not a
directory.
[EPERM] A pathname contains a character with the high-
order bit set.
[ENAMETOOLONG]
A component of a pathname exceeded NAME_MAX
characters, or an entire pathname exceeded
PATH_MAX.
[ELOOP] Too many symbolic links were encountered in
translating a pathname.
[ENOENT] The named file does not exist.
[EACCES] Search permission is denied for a component of
the path prefix.
[EFAULT] path points to an invalid address.
fpathconf will also fail if the following condition occurs:
[EBADF] fields is not a valid open file descriptor.
[EINVAL] Name is not equal to one of the allowable
values above or name cannot be associated with
the specified file or directory.
Page 2 May 1989
PATHCONF(2P) PATHCONF(2P)
SEE ALSO
sysconf(3P).
Page 3 May 1989