fpathconf(2)


fpathconf, pathconf -- get configurable pathname variables

Synopsis

   #include <unistd.h>
   

long fpathconf(int fildes, int name);

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

Description

The functions fpathconf and pathconf return the current value of a configurable limit or option associated with a file or directory. The path argument points to the pathname of a file or directory; fildes is an open file descriptor; and name is the symbolic constant defined in unistd.h [see unistd(4)] representing the configurable system limit or option to be returned.

The value of the configurable system limit or option specified by name does not change during the lifetime of the calling process.

Return values

The values returned by pathconf and fpathconf depend on the type of file specified by path or fildes. The following table contains the symbolic constants supported by pathconf and fpathconf along with the POSIX defined return value. The return value is based on the type of file specified by path or fildes.

Value of name See Note
_PC_LINK_MAX 1
_PC_MAX_CANNON 2
_PC_MAX_INPUT 2
_PC_NAME_MAX 3,4
_PC_PATH_MAX 4,5
_PC_PIPE_BUF 6
_PC_CHOWN_RESTRICTED 7
_PC_NO_TRUNC 3,4
_PC_VDISABLE 2
_PC_FILESIZEBITS 3,4

 Value of name         |  See Note
 _PC_LINK_MAX          |  1
 _PC_MAX_CANNON        |  2
 _PC_MAX_INPUT         |  2
 _PC_NAME_MAX          |  3,4
 _PC_PATH_MAX          |  4,5
 _PC_PIPE_BUF          |  6
 _PC_CHOWN_RESTRICTED  |  7
 _PC_NO_TRUNC          |  3,4
 _PC_VDISABLE          |  2
 _PC_FILESIZEBITS      |  3,4

Notes:


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

2
The behavior is undefined if path or fildes does not refer to a terminal file.

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

4
The behavior is undefined if path or fildes does not refer to a directory.

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

6
If path or fildes refers to a pipe or FIFO, the value returned applies to the FIFO itself. If path or fildes refers to a directory, the value returned applies to any FIFOs that exist or can be created within the directory. If path or fildes refer to any other type of file, the behavior is undefined.

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

If fpathconf or pathconf are invoked with a symbolic constant that corresponds to a configurable system limit or option without a fixed upper bound, a value of -1 is returned and the value of errno is not changed.

Errors

The fpathconf call fails and sets errno as shown if:

EINVAL
The value of name is not valid, or the association of the variable name with the specified file is not supported.

EBADF
The fildes argument is not a valid file descriptor.

The pathconf call fails and sets errno as shown if:


EACCES
Search permission is denied for a component of the path prefix; or, read permission is denied on the named file.

EINVAL
The value of name is not valid, or the association of the variable name with the specified file is not supported.

ELOOP
Too many symbolic links are encountered while translating path.

EMULTIHOP
Components of path require hopping to multiple remote machines and file system type does not allow it.

ENAMETOOLONG
The length of a pathname exceeds PATH_MAX, or pathname component is longer than NAME_MAX while _POSIX_NO_TRUNC is in effect; or, pathname resolution of a symbolic link produced an intermediate result whose length exceeds PATH_MAX.

ENOENT
A component of path does not name an existing file or path is an empty string.

ENOLINK
path points to a remote machine and the link to that machine is no longer active.

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

References

limits(4), sysconf(3C), unistd(4)
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004