Retrieves file-implementation characteristics.
#include <unistd.h>
long pathconf ( Path, Name)
const char *Path;
int Name;
long fpathconf( FileDescriptor, Name)
int FileDescriptor, Name;
The pathconf subroutine allows an application to determine the characteristics of operations supported by the file system contained by the file named by the Path parameter. 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 fpathconf subroutine allows an application to retrieve the same information for an open file.
Notes:
- If the Name parameter has a value of _PC_LINK_MAX, and if the Path or FileDescriptor parameter refers to a directory, the value returned applies to the directory itself.
- If the Name parameter has a value of _PC_NAME_MAX or _PC_NO_TRUNC, and if the Path or FileDescriptor parameter refers to a directory, the value returned applies to filenames within the directory.
- If the Name parameter has a value if _PC_PATH_MAX, and if the Path or FileDescriptor parameter refers to a directory that is the working directory, the value returned is the maximum length of a relative pathname.
- If the Name parameter has a value of _PC_PIPE_BUF, and if the Path parameter refers to a FIFO special file or the FileDescriptor parameter refers to a pipe or a FIFO special file, the value returned applies to the referenced object. If the Path or FileDescriptor parameter refers to a directory, the value returned applies to any FIFO special file that exists or can be created within the directory.
- If the Name parameter has a value of _PC_CHOWN_RESTRICTED, and if the Path or FileDescriptor parameter refers to a directory, the value returned applies to any files, other than directories, that exist or can be created within the directory.
If the pathconf or fpathconf subroutine is successful, the specified parameter is returned. Otherwise, a value of -1 is returned and the errno global variable is set to indicate the error. If the variable corresponding to the Name parameter has no limit for the Path parameter or the FileDescriptor parameter, both the pathconf and fpathconf subroutines return a value of -1 without changing the errno global variable.
The pathconf or
fpathconf subroutine fails if the following error occurs:
EINVAL | The name parameter specifies an unknown or inapplicable characteristic. |
The pathconf
subroutine can also fail if any of the following errors occur:
The fpathconf
subroutine can fail if either of the following errors occur:
EBADF | The File Descriptor parameter is not valid. |
EINVAL | The implementation does not support an association of the Name parameter with the specified file. |
These subroutines are part of Base Operating System (BOS) Runtime.
The chown (chown, fchown, lchown, chownx, or fchownx Subroutine) subroutine, confstr (confstr Subroutine) subroutine, sysconf subroutine.
Files, Directories, and File Systems for Programmers, Subroutines Overview in AIX 5L Version 5.1 General Programming Concepts: Writing and Debugging Programs.