Content-type: text/html Man page of pathconf

pathconf

Section: System Calls (2)
Index Return to Main Contents
 

NAME

pathconf, fpathconf - Retrieve file implementation characteristics  

SYNOPSIS

#include <unistd.h>

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, XPG4, XPG4-UNIX

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

PARAMETERS

Specifies the pathname. If the final component of path is a symbolic link, it will be traversed and filename resolution will continue. Specifies an open file descriptor. Specifies the configuration attribute to be queried.  

DESCRIPTION

The fpathconf() and pathconf() functions provide a method for an application 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.

The maximum number of links to the file.

If path or filedes refers to a directory, the value returned applies to the directory itself.
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. 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. The maximum number of bytes in a filename (not including a terminating 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. The maximum number of bytes in a pathname (including a terminating 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. 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. 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. Returns 0 (zero) if supplying a component name longer than allowed by NAME_MAX will cause an error. Returns 1 if long component 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. 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: Search permission is denied for a component of the path prefix. [XPG4-UNIX]  Too many links were encountered in translating a pathname. The name parameter specifies an unknown or inapplicable characteristic. [Digital]  The path argument is an invalid address. The length of the path string exceeds PATH_MAX or a pathname component is longer than NAME_MAX.

[XPG4-UNIX]  Pathname resolution of a symbolic link produced an intermediate result whose length exceeds PATH_MAX. The named file does not exist or the path argument points to an empty string. A component of the path prefix is not a directory.

If the fpathconf() function fails, errno may be set to the following value: The name parameter specifies an unknown or inapplicable characteristic. The filedes argument is not a valid file descriptor. [Digital]  The named file has been revoked.  

RELATED INFORMATION

Standards: standards(5) delim off


 

Index

NAME
SYNOPSIS
STANDARDS
PARAMETERS
DESCRIPTION
RETURN VALUES
ERRORS
RELATED INFORMATION

This document was created by man2html, using the manual pages.
Time: 02:40:16 GMT, October 02, 2010