Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

sysconf(3)

PATHCONF(3)                          SysV                          PATHCONF(3)



NAME
     pathconf, fpathconf - retrieve configurable pathname variables

SYNOPSIS
     #include <unistd.h>

     long pathconf (path, name)
     const char *path;
     int name;

     long fpathconf (filedes, name)
     int filedes, name;

DESCRIPTION
     The pathconf and fpathconf functions allow applications to determine the
     current value of a configurable system limit or option (variable)
     associated with a file or directory.

     For pathconf, the path argument points to the pathname of a file or
     directory. If the final component of path is a symbolic link, it will be
     traversed and the pathname resolution will continue.

     For fpathconf, the filedes argument is an open file descriptor.

     The name argument represents the variable to be queried relative to that
     file. The variables are defined in <limits.h> or <unistd.h>, and the
     symbolic constants are defined in <unistd.h> as follows:

     _PC_LINK_MAX     The maximum number of links to the file. If the path or
                      filedes argument refers to a directory, the value
                      returned applies to the directory itself.

     _PC_MAX_CANON    The maximum number of bytes in a canonical input line.
                      This is applicable only to terminal devices.

     _PC_MAX_INPUT    The number of types allowed in an input queue. This is
                      applicable only to terminal devices.

     _PC_NAME_MAX     Maximum number of characters in a filename (not
                      including a terminating null). This is applicable only
                      to a directory file.  The value returned applies to
                      filenames within the directory.

     _PC_PATH_MAX     Maximum number of characters in a pathname (not
                      including a terminating null). This is applicable only
                      to a directory file.  The value returned is the maximum
                      length of a relative pathname when the specified
                      directory is the working directory.

     _PC_PIPE_BUF     Maximum number of bytes guaranteed to be written
                      atomically. This is applicable only to a FIFO or a
                      directory.  The value returned applies to the referenced
                      object.  If the path or filedes argument refers to a
                      directory, the value returned applies to any FIFO that
                      exists or can be created within the directory.

     _PC_CHOWN_RESTRICTED
                      This is applicable only to a directory file.  The value
                      returned applies to any files (other than directories)
                      that exist or can be created within the directory.
                      Returns 1 if the use of 3chown on files in the directory
                      is restricted to process with appropritate privileges;
                      otherwise -1 is returned.

     _PC_NO_TRUNC     Returns 1 if supplying a component name longer than
                      allowed by NAME_MAX will cause an error. Returns 0
                      (zero) if long component names are truncated. This is
                      applicable only to a directory file.

     _PC_VDISABLE     This is always 0 (zero); no disabling character is
                      defined. This is applicable only to a terminal device.

NOTES
     For FIPS compliance, if name is _PC_CHOWN_RESTRICTED, _PC_NO_TRUNC, or
     _PC_VDISABLE, and no error conditions are detected, pathconf and
     fpathconf will return a negative value.

DIAGNOSTICS
     If the variable corresponding to name is an invalid value, pathconf and
     fpathconf return -1 without changing errno.

     If the variable corresponding to name has no limit for the path or file
     descriptor, pathconf and fpathconf return -1 without changing errno.

     If the process does not have the appropriate privileges to query the file
     specified by path or filedes, or path does not exist, or filedes is not a
     valid descriptor, pathconf() or fpathconf() returns -1.

     Otherwise, upon successful completion, the pathconf or fpathconf function
     returns the specified argument without changing errno. The value returned
     is not more restrictive than the corresponding value available to the
     application when it was compiled with the <unistd.h> header file.

ERRORS
     The pathconf function fails if:

     [EINVAL]  The value of name is not valid.

     The fpathconf function fails if:

     [EINVAL]  The value of name is not valid.

SEE ALSO
     sysconf(3), <limits.h>

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026