Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

chown(2)

execve(2)

tty(4)

PATHCONF(3)                 BSD Programmer's Manual                PATHCONF(3)

NAME
     pathconf, fpathconf, sysconf - configurable variables

SYNOPSIS
     #include <unistd.h>

     long
     pathconf(const char *path, int name)

     long
     fpathconf(int fd, int name)

     long
     sysconf(int name)

DESCRIPTION
     Certain system parameters may be dependent on configuration.  The
     pathconf() and fpathconf() functions recover configurable variables asso-
     ciated with files, while the sysconf() function recovers configurable
     variables associated with the system.

     The pathconf() function operates on a named file, while the fpathconf()
     function operates on an open file descriptor.  The configurable variables
     associated with these functions include the following:

     _PC_LINK_MAX          The maximum number of hard links to the given file
                           or directory.
     _PC_MAX_CANON         The maximum number of bytes in the given tty(4)'s
                           canonical input queue.
     _PC_MAX_INPUT         The maximum number of bytes in the given tty(4)'s
                           input queue.
     _PC_NAME_MAX          The maximum number of bytes in a filename in the
                           given directory.
     _PC_PATH_MAX          The maximum number of bytes in a pathname relative
                           to the given directory.
     _PC_PIPE_BUF          The maximum number of bytes that can be written to
                           the given pipe or FIFO at one time.  If the given
                           file is a directory, returns the value for a FIFO
                           that could be created in that directory.
     _PC_CHOWN_RESTRICTED  Returns 1 if only root can use chown(2) to change
                           the owner of the given file and only root or the
                           owner of the file may change its group; otherwise
                           returns 0.  If the given file is a directory, re-
                           turns the value appropriate to a file which could
                           be created in that directory.
     _PC_NO_TRUNC          For the given directory, returns 1 if excessively
                           long filenames generate errors; returns 0 if file-
                           names are silently truncated to their maximum
                           length.
     _PC_VDISABLE          For the given tty(4),  returns 1 if the
                           _POSIX_VDISABLE feature is available to disable use
                           of specific special characters; otherwise returns
                           0.

     The sysconf() function handles the following configurable variables:

     _SC_ARG_MAX           The maximum number of bytes in argument and envi-
                           ronment strings passed to execve(2).
     _SC_CHILD_MAX         The maximum number of children for any process.
     _SC_CLK_TCK           The number of system clock ticks per second.
     _SC_JOB_CONTROL       Returns 1 if job control is available, 0 otherwise.


     _SC_NGROUPS_MAX       The maximum number of supplementary group IDs for
                           any process.
     _SC_OPEN_MAX          The maximum number of open file descriptors for any
                           process.
     _SC_SAVED_IDS         Returns 1 if the IEEE Std1003.1-1988 (``POSIX'')
                           saved group and user ID feature is available, 0
                           otherwise.
     _SC_STREAM_MAX        The maximum number of open stdio streams for any
                           process.
     _SC_TZNAME_MAX        The maximum number of bytes in a time zone name.
     _SC_VERSION           Returns an integer indicating the IEEE
                           Std1003.1-1988 (``POSIX'') conformance level.

RETURN VALUES
     The functions pathconf(), fpathconf() and sysconf() all return -1 and set
     errno if name is invalid.  For pathconf() and fpathconf(), if name
     doesn't have a limit, or for sysconf(), if the feature denoted by name
     isn't supported, the function returns -1 and does not set errno. For
     pathconf() and fpathconf(), if the system needs the given file or file
     descriptor to return the value for name, and the file or file descriptor
     is unusable for some reason, the function returns -1 and sets errno.

ERRORS
     The functions pathconf(), fpathconf() and sysconf() may fail and set
     errno as follows:

     [EINVAL]        The value of name is not recognized.

     The functions pathconf() and fpathconf() may fail and set errno as fol-
     lows:

     [EINVAL]        The feature requested by name is meaningless when applied
                     to path or fd, respectively.

     The function pathconf() may fail and set errno as follows:

     [EACCES]        Permission is denied to search a directory in path.

     [ENAMETOOLONG]  The length of path exceeds the appropriate limit either
                     in total or in some element.

     [ENOENT]        path doesn't exist.

     [ENOTDIR]       Some element of path is not a directory.

     The function fpathconf() may fail and set errno as follows:

     [EBADF]         The file descriptor fd is not open.

SEE ALSO
     chown(2),  execve(2),  tty(4)

STANDARDS
     These functions are defined by IEEE Std1003.1-1988 (``POSIX'').

HISTORY
     These functions are currently under development.

BUGS
     The current implementation is a hack in a library routine and ignores
     path and variable limits.

BSDI BSD/386                    March 26, 1993                               2




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