pathconf(3P) pathconf(3P)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 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, fildes 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_CHOWN_SUP_GRP _PC_DIR_DOTS _PC_GROUP_PARENT _PC_LINK_DIR _PC_NO_TRUNC _PC_UTIME_OWNER _PC_VDISABLE STATUS MESSAGES AND VALUES If the named variable is not defined on the system, or 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 if path does not exist, pathconf returns -1. If the named variable is not defined on the system, or if name is not a valid variable name, or if the variable cannot be associated with the specified file or directory, fpathconf returns -1. January 1992 1
pathconf(3P) pathconf(3P)If none of the above are true, pathconf and fpathconf return the current value associated with the variable for the file or directory. The pathconf and fpathconf programs will fail if one or more of the following are true: ENOTDIR A component of the path prefix is not a directory. 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. EINVAL The value of the name is invalid, or the variable name is not associated with the specified file. fpathconf will also fail if the following condition occurs: EBADF The open file descriptor, fildes, is not valid. SEE ALSO sysconf(3P) 2 January 1992