COHERENT manpages

This page displays the COHERENT manpage for pathconf() [Get a file variable by path name].

List of available manpages
Index


pathconf() -- System Call (libc)

Get a file variable by path name
#include <unistd.h>
long pathconf(path, name)
const char *path; int name;

pathconf() returns the value of a  limit or option associated with the file
path.  name  is  a symbolic  constant  (defined  in <unistd.h>)  that
represents the  limit or option to be returned.   The value that pathconf()
returns depends upon the type of file that path names.

pathconf() can return information about the following constants:

_PC_LINK_MAX
     The maximum value of a file's  link count.  If path names a directory,
     the value returned applies to the directory itself.

_PC_MAX_CANON
     The number  of bytes in a terminal's  canonical input queue.  Behavior
     is undefined if path does not name a terminal file.

_PC_MAX_INPUT
     The number of bytes for which  space will be available in a terminal's
     input queue.   Behavior is undefined if path does  not name a terminal
     file.

_PC_NAME_MAX
     The number of  bytes in a file name.  The  behavior is refined if path
     does not  name a  directory.  The value  returned applies to  the file
     names within the directory.

_PC_PATH_MAX
     The number  of bytes in  a path name.   Behavior is undefined  if path
     does  not refer  to a  directory.  If path  names the  current working
     directory, pathconf()  returns the maximum  length of a  relative path
     name.

_PC_PIPE_BUF
     The number of  bytes that can be written atomically  when writing to a
     pipe.  If path names a pipe or FIFO, the value returned applies to the
     FIFO itself.  If path names a directory, the value returned applies to
     any FIFOs that exist or can be created within that directory.  If path
     names any other type of file, behavior is undefined.

_PC_CHOWN_RESTRICTED
     chown() can be used only by a process with appropriate privileges, and
     only  to change  the  group ID  of  a file  to  either that  process's
     effective group  ID or  one of its  supplementary group IDs.   If path
     names a directory, the value  returned applies to any file, other than
     a directory, that exists or can be created within the directory.

_PC_NO_TRUNC
     Path-name  components longer  than  NAME_MAX generate  an error.   The
     behavior is undefined if path does not refer to a directory.  The value
     returned applies to the file names within the directory.

_PC_VDISABLE
     If this value is defined, terminal-special characters can be disabled.
     Behavior is undefined if path does not name a terminal file.

The value of the system limit or option that name specifies does not change
during the lifetime of the calling process.

pathconf()  fails  and returns  -1  if  name is  not  set  to a  recognized
constant.  It fails, returns -1, and  sets errno to an appropriate value if
any of the following is true:

-> The process that calls pathconf() lacks permission to search a directory
   named in path. pathconf() sets errno to EACCES.

-> path is  needed for  the command  specified and it  either points  to an
   empty string or names a file that does not exist.  pathconf() sets errno
   to ENOENT.

-> A component of path's prefix  is not a directory.  pathconf() sets errno
   to ENOTDIR.

-> name is an invalid value.  pathconf() sets errno to EINVAL.

See Also

fpathconf(),
libc
POSIX Standard, §5.7.1