1FPATHCONF(3) Linux Programmer's Manual FPATHCONF(3)
2
3
4
6 fpathconf, pathconf - get configuration values for files
7
9 #include <unistd.h>
10
11 long fpathconf(int fd, int name);
12 long pathconf(const char *path, int name);
13
15 fpathconf() gets a value for the configuration option name for the open
16 file descriptor fd.
17
18 pathconf() gets a value for configuration option name for the filename
19 path.
20
21 The corresponding macros defined in <unistd.h> are minimum values; if
22 an application wants to take advantage of values which may change, a
23 call to fpathconf() or pathconf() can be made, which may yield more
24 liberal results.
25
26 Setting name equal to one of the following constants returns the fol‐
27 lowing configuration options:
28
29 _PC_LINK_MAX
30 The maximum number of links to the file. If fd or path refer to
31 a directory, then the value applies to the whole directory. The
32 corresponding macro is _POSIX_LINK_MAX.
33
34 _PC_MAX_CANON
35 The maximum length of a formatted input line, where fd or path
36 must refer to a terminal. The corresponding macro is
37 _POSIX_MAX_CANON.
38
39 _PC_MAX_INPUT
40 The maximum length of an input line, where fd or path must refer
41 to a terminal. The corresponding macro is _POSIX_MAX_INPUT.
42
43 _PC_NAME_MAX
44 The maximum length of a filename in the directory path or fd
45 that the process is allowed to create. The corresponding macro
46 is _POSIX_NAME_MAX.
47
48 _PC_PATH_MAX
49 The maximum length of a relative pathname when path or fd is the
50 current working directory. The corresponding macro is
51 _POSIX_PATH_MAX.
52
53 _PC_PIPE_BUF
54 The maximum number of bytes that can be written atomically to a
55 pipe of FIFO. For fpathconf(), fd should refer to a pipe or
56 FIFO. For fpathconf(), path should refer to a FIFO or a direc‐
57 tory; in the latter case, the returned value corresponds to
58 FIFOs created in that directory. The corresponding macro is
59 _POSIX_PIPE_BUF.
60
61 _PC_CHOWN_RESTRICTED
62 This returns a positive value if the use of chown(2) and
63 fchown(2) for changing a file's user ID is restricted to a
64 process with appropriate privileges, and changing a file's group
65 ID to a value other than the process's effective group ID or one
66 of its supplementary group IDs is restricted to a process with
67 appropriate privileges. According to POSIX.1, this variable
68 shall always be defined with a value other than -1. The corre‐
69 sponding macro is _POSIX_CHOWN_RESTRICTED.
70
71 If fd or path refers to a directory, then the return value
72 applies to all files in that directory.
73
74 _PC_NO_TRUNC
75 This returns nonzero if accessing filenames longer than
76 _POSIX_NAME_MAX generates an error. The corresponding macro is
77 _POSIX_NO_TRUNC.
78
79 _PC_VDISABLE
80 This returns nonzero if special character processing c