unixdev.net


Switch to SpeakEasy.net DSL

The Modular Manual Browser

Home Page
Manual: (OSF1-V5.1-alpha)
Page:
Section:
Apropos / Subsearch:
optional field



pathconf(2)							  pathconf(2)



NAME

  pathconf, fpathconf -	Retrieve file implementation characteristics

SYNOPSIS

  #include <&lt;unistd.h>&gt;

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

  long fpathconf(
	  int filedes,
	  int name);

STANDARDS

  Interfaces documented	on this	reference page conform to industry standards
  as follows:

  fpathconf(), pathconf():  POSIX.1, XSH5.0

  Refer	to the standards(5) reference page for more information	about indus-
  try standards	and associated tags.

PARAMETERS

  path	    Specifies the pathname.  If	the final component of path is a sym-
	    bolic link,	it will	be traversed and filename resolution will
	    continue.

  filedes   Specifies an open file descriptor.

  name	    Specifies the configuration	attribute to be	queried.

DESCRIPTION

  The fpathconf() and pathconf() functions provide a method for	an applica-
  tion to determine the	current	value of a configurable	limit or option
  (variable) that is associated	with a file or directory.

  For pathconf(), the path parameter points to the pathname of a file or
  directory.  Read, write, or execute permission of the	named file is not
  required, but	all directories	in the path leading to the file	must be
  searchable.

  The following	is a list of the system	variables whose	values are returned
  by pathconf()	and fpathconf()	and the	symbolic constants (shown in
  parentheses) that are	the corresponding values used for the name parameter.
  The variables	come from either the limits.h or unistd.h header file and the
  symbolic constants are defined in unistd.h.

  FILESIZEBITS (_PC_FILESIZEBITS)
	    The	minimum	number of bits needed to represent as a	signed
	    integer value the maximum size of a	regular	file that is allowed
	    in the specified directory.

  LINK_MAX  (_PC_LINK_MAX)
	    The	maximum	number of links	to the file.

	    If path or filedes refers to a directory, the value	returned
	    applies to the directory itself.



  MAX_CANON  (_PC_MAX_CANON)
	    The	maximum	number of bytes	in a canonical input line.

	    The	association of this variable name with the specified file is
	    guaranteed only when path or filedes refers	to a terminal file.

  MAX_INPUT  (_PC_MAX_INPUT)
	    The	minimum	number of bytes	for which space	is available in	an
	    input queue; therefore, the	maximum	number of bytes	a portable
	    application	may require to be typed	as input before	reading	them.

	    The	association of this variable name with the specified file is
	    guaranteed only when path or filedes refers	to a terminal file.

  NAME_MAX  (_PC_NAME_MAX)
	    The	maximum	number of bytes	in a filename (not including a ter-
	    minating null).

	    If path or filedes refers to a directory, the value	returned
	    applies to filenames within	the directory.

	    The	association of this variable name with the specified file is
	    guaranteed only when path or filedes refers	to a directory.

  PATH_MAX  (_PC_PATH_MAX)
	    The	maximum	number of bytes	in a pathname (including a terminat-
	    ing	null).

	    If path or filedes refers to a directory, the value	returned is
	    the	maximum	length of a relative pathname when the specified
	    directory is the working directory.

	    The	association of this variable name with the specified file is
	    guaranteed only when path or filedes refers	to a directory.

  PIPE_BUF  (_PC_PIPE_BUF)
	    The	maximum	number of bytes	guaranteed to be atomic	when writing
	    to a pipe.

	    If path refers to a	FIFO, or filedes refers	to a pipe or FIFO,
	    the	value returned applies to the referenced object.  If path or
	    filedes refers to a	directory, the value returned applies to any
	    FIFO that exists or	can be created within the directory.

	    The	association of this variable name with the specified file is
	    not	guaranteed if path or filedes refers to	any other type of
	    file.

  _POSIX_ACL_EXTENDED  (_PC_ACL_EXTENDED)
	    The	Access Control List (ACL) processing status value for the
	    file.  The return indicates	if an ACL can be set on	the file and
	    if ACL processing is enabled for the file.	The return does	not
	    indicate if	an ACL is set on the file.

	    Returns 1 if ACLs are supported and	enabled	for the	file.  This
	    indicates that ACLs	can be set on the file and that	ACL checking
	    and	ACL inheritance	are enabled on the file.

	    Returns 0 if ACLs are supported for	the file, but are not
	    enabled.  This indicates that ACLs can be set on the file, but
	    that ACL checking and ACL inheritance are not enabled on the
	    file.

	    Returns -1 with errno set to EINVAL	if ACLs	are not	supported for
	    the	file.  This indicates that the filesystem containing the file
	    does not support ACLs.

  _POSIX_CHOWN_RESTRICTED  (_PC_CHOWN_RESTRICTED)
	    The	use of chown() is restricted to	a process with appropriate
	    privileges,	and to changing	the group ID of	a file only to the
	    effective group ID of the process or to one	of its supplementary
	    group IDs.

	    If the path	or filedes parameter refers to a directory, the	value
	    returned applies to	any files (other than directories) that	exist
	    or can be created within the directory.

  _POSIX_NO_TRUNC  (_PC_NO_TRUNC)
	    Returns 0 (zero) if	supplying a component name longer than
	    allowed by NAME_MAX	will cause an error. Returns 1 if long com-
	    ponent names are truncated.

	    If path or filedes refers to a directory, the value	returned
	    applies to filenames within	the directory.

	    The	association of this variable name with the specified file is
	    guaranteed only when path or filedes refers	to a directory.

  _POSIX_VDISABLE  (_PC_VDISABLE)
	    A character	value used to disable terminal special characters.

	    The	association of this variable name with the specified file is
	    guaranteed only when path or filedes refers	to a terminal file.

RETURN VALUES

  Upon successful completion, the pathconf() or	fpathconf() function returns
  the specified	parameter.

  If name is an	invalid	value, both pathconf() and fpathconf() return -1 and
  errno	is set to indicate the error.

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

ERRORS

  If the pathconf() function fails, errno may be set to	the following value:

  [EACCES]  Search permission is denied	for a component	of the path prefix.

  [ELOOP]   Too	many symbolic links were encountered in	translating a path-
	    name.

  [EINVAL]  The	name parameter is invalid.

  [EFAULT]  [Tru64 UNIX]  The path argument is an invalid address.

  [ENAMETOOLONG]
	    The	length of the path string exceeds PATH_MAX or a	pathname com-
	    ponent is longer than NAME_MAX.

	    Pathname resolution	of a symbolic link produced an intermediate
	    result whose length	exceeds	PATH_MAX.

  [ENOENT]  The	named file does	not exist or the path argument points to an
	    empty string.

  [ENOTDIR] A component	of the path prefix is not a directory.

  If the fpathconf() function fails, errno may be set to the following value:

  [EINVAL]  The	name parameter specifies an unknown or inapplicable charac-
	    teristic.

  [EBADF]   The	filedes	argument is not	a valid	file descriptor.

  [EIO]	    [Tru64 UNIX]  The named file has been revoked.

RELATED	INFORMATION

  Standards: standards(5)