| fpathconf(3) | Library Functions Manual | fpathconf(3) |
NAME
fpathconf, pathconf - get configuration values for files
LIBRARY
Standard C library (libc, -lc)
SYNOPSIS
#include <unistd.h>
long fpathconf(int fd, int name);
long pathconf(const char *path, int name);
DESCRIPTION
fpathconf() gets a value for the configuration option name for the open file descriptor fd.
pathconf() gets a value for configuration option name for the filename path.
The corresponding macros defined in <unistd.h> are minimum values; if an application wants to take advantage of values which may change, a call to fpathconf() or pathconf() can be made, which may yield more liberal results.
Setting name equal to one of the following constants returns the following configuration options:
- _PC_LINK_MAX
- The maximum number of links to the file. If fd or path refer to a directory, then the value applies to the whole directory. The corresponding macro is _POSIX_LINK_MAX.
- _PC_MAX_CANON
- The maximum length of a formatted input line, where fd or path must refer to a terminal. The corresponding macro is _POSIX_MAX_CANON.
- _PC_MAX_INPUT
- The maximum length of an input line, where fd or path must refer to a terminal. The corresponding macro is _POSIX_MAX_INPUT.
- _PC_NAME_MAX
- The maximum length of a filename in the directory path or fd that the process is allowed to create. The corresponding macro is _POSIX_NAME_MAX.
- _PC_PATH_MAX
- The maximum length of a relative pathname when path or fd is the current working directory. The corresponding macro is _POSIX_PATH_MAX.
- _PC_PIPE_BUF
- The maximum number of bytes that can be written atomically to a pipe of FIFO. For fpathconf(), fd should refer to a pipe or FIFO. For fpathconf(), path should refer to a FIFO or a directory; in the latter case, the returned value corresponds to FIFOs created in that directory. The corresponding macro is _POSIX_PIPE_BUF.
- _PC_CHOWN_RESTRICTED
- This returns a positive value if the use of chown(2) and fchown(2) for changing a file's user ID is restricted to a process with appropriate privileges, and changing a file's group ID to a value other than the process's effective group ID or one of its supplementary group IDs is restricted to a process with appropriate privileges. According to POSIX.1, this variable shall always be defined with a value other than -1. The corresponding macro is _POSIX_CHOWN_RESTRICTED.
- If fd or path refers to a directory, then the return value applies to all files in that directory.
- _PC_NO_TRUNC
- This returns nonzero if accessing filenames longer than _POSIX_NAME_MAX generates an error. The corresponding macro is _POSIX_NO_TRUNC.
- _PC_VDISABLE
- This returns nonzero if special character processing can be disabled, where fd or path must refer to a terminal.
RETURN VALUE
The return value of these functions is one of the following:
- •
- On error, -1 is returned and errno is set to indicate the error (for example, EINVAL, indicating that name is invalid).
- •
- If name corresponds to a maximum or minimum limit, and that limit is indeterminate, -1 is returned and errno is not changed. (To distinguish an indeterminate limit from an error, set errno to zero before the call, and then check whether errno is nonzero when -1 is returned.)
- •
- If name corresponds to an option, a positive value is returned if the option is supported, and -1 is returned if the option is not supported.
- •
- Otherwise, the current value of the option or limit is returned. This value will not be more restrictive than the corresponding value that was described to the application in <unistd.h> or <limits.h> when the application was compiled.
ERRORS
- EACCES
- (pathconf()) Search permission is denied for one of the directories in the path prefix of path.
- EBADF
- (fpathconf()) fd is not a valid file descriptor.
- EINVAL
- name is invalid.
- EINVAL
- The implementation does not support an association of name with the specified file.
- ELOOP
- (pathconf()) Too many symbolic links were encountered while resolving path.
- ENAMETOOLONG
- (pathconf()) path is too long.
- ENOENT
- (pathconf()) A component of path does not exist, or path is an empty string.
- ENOTDIR
- (pathconf()) A component used as a directory in path is not in fact a directory.
ATTRIBUTES
For an explanation of the terms used in this section, see attributes(7).
| Interface | Attribute | Value |
| fpathconf (), pathconf () | Thread safety | MT-Safe |
STANDARDS
POSIX.1-2008.
HISTORY
POSIX.1-2001.
NOTES
Files with name lengths longer than the value returned for name equal to _PC_NAME_MAX may exist in the given directory.
Some returned values may be huge; they are not suitable for allocating memory.
SEE ALSO
| 2025-09-21 | Linux man-pages (unreleased) |
Different Versions of this Page:
- Version 6.17 (latest)
- Version 6.16
- Version 6.15
- Version 6.14
- Version 6.13
- Version 6.12
- Version 6.11
- Version 6.10
- Version 6.9.1
- Version 6.9
- Version 6.8
- Version 6.7
- Version 6.06
- Version 6.05.01
- Version 6.05
- Version 6.04
- Version 6.03
- Version 6.02
- Version 6.01
- Version 6.00
- Version 5.13
- Version 5.12
- Version 5.11
- Version 5.10
- Version 5.09
- Version 5.08
- Version 5.07
- Version 5.06
- Version 5.05
- Version 5.04
- Version 5.03
- Version 5.02
- Version 5.01
- Version 5.00
- Version 4.16
- Version 4.15
- Version 4.14
- Version 4.13
- Version 4.12
- Version 4.10
- Version 4.09
- Version 4.08
- Version 4.07
- Version 4.06
- Version 4.05
- Version 4.04
- Version 4.03
- Version 4.02
- Version 4.01
- Version 4.00
- Version 3.83
- Version 3.82
- Version 3.81
- Version 3.80
- Version 3.79
- Version 3.78
- Version 3.77
- Version 3.76
- Version 3.75
- Version 3.74
- Version 3.73
- Version 3.72
- Version 3.71
- Version 3.70
- Version 3.69
- Version 3.68
- Version 3.67
- Version 3.66
- Version 3.65
- Version 3.64
- Version 3.63
- Version 3.62
- Version 3.61
- Version 3.60
- Version 3.59
- Version 3.58
- Version 3.57
- Version 3.56
- Version 3.55
- Version 3.54
- Version 3.53
- Version 3.52
- Version 3.49
- Version 3.48
- Version 3.47
- Version 3.46
- Version 3.45
- Version 3.44
- Version 3.43
- Version 3.42
- Version 3.41
- Version 3.40
- Version 3.39
- Version 3.38
- Version 3.37
- Version 3.36
- Version 3.35
- Version 3.34
- Version 3.33
- Version 3.32
- Version 3.31
- Version 3.30
- Version 3.29
- Version 3.28
- Version 3.27
- Version 3.26
- Version 3.25
- Version 3.24
- Version 3.23
- Version 3.22
- Version 3.21
- Version 3.20
- Version 3.17
- Version 3.16
- Version 3.15
- Version 3.14
- Version 3.13
- Version 3.12
- Version 3.11
- Version 3.10
- Version 3.09
- Version 3.08
- Version 3.07
- Version 3.06
- Version 3.05
- Version 3.04
- Version 3.03
- Version 3.02
- Version 3.01
- Version 3.00
- Version 2.80
- Version 2.79
- Version 2.78
- Version 2.77
- Version 2.76
- Version 2.75
- Version 2.74
- Version 2.73
- Version 2.72
- Version 2.71
- Version 2.70
- Version 2.69
- Version 2.68
- Version 2.67
- Version 2.66
- Version 2.65
- Version 2.64
- Version 2.63
- Version 2.62
- Version 2.61
- Version 2.60
- Version 2.59
- Version 2.58
- Version 2.57
- Version 2.56
- Version 2.55
- Version 2.54
- Version 2.53
- Version 2.52
- Version 2.51
- Version 2.50
- Version 2.49
- Version 2.48
- Version 2.47
- Version 2.46
- Version 2.45
- Version 2.44
- Version 2.43
- Version 2.42
- Version 2.41
- Version 2.40
- Version 2.39
- Version 2.38
- Version 2.37
- Version 2.36
- Version 2.35
- Version 2.34
- Version 2.33
- Version 2.32
- Version 2.31
- Version 2.30
- Version 2.29
- Version 2.28
- Version 2.27
- Version 2.26
- Version 2.25
- Version 2.24
- Version 2.23
- Version 2.22
- Version 2.21
- Version 2.20
- Version 2.19
- Version 2.18
- Version 2.17
- Version 2.16
- Version 2.15
- Version 2.14
- Version 2.13
- Version 2.12
- Version 2.11
- Version 2.10
- Version 2.09
- Version 2.08
- Version 2.07
- Version 2.06
- Version 2.05
- Version 2.04
- Version 2.03
- Version 2.02
- Version 2.01
- Version 2.00