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