1 .\" $NetBSD: pathconf.2,v 1.28 2014/06/09 09:15:48 njoly Exp $
4 .\" The Regents of the University of California. All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
14 .\" 3. Neither the name of the University nor the names of its contributors
15 .\" may be used to endorse or promote products derived from this software
16 .\" without specific prior written permission.
18 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" @(#)pathconf.2 8.1 (Berkeley) 6/4/93
38 .Nd get configurable pathname variables
44 .Fn pathconf "const char *path" "int name"
46 .Fn fpathconf "int fd" "int name"
52 functions provide a method for applications to determine the current
53 value of a configurable system limit or option variable associated
54 with a pathname or file descriptor.
60 argument is the name of a file or directory.
65 argument is an open file descriptor.
68 argument specifies the system variable to be queried.
69 Symbolic constants for each name value are found in the
73 The available values are as follows:
74 .Bl -tag -width "123456"
76 The maximum file link count.
78 The maximum number of bytes in terminal canonical input line.
80 The minimum maximum number of bytes for which space is available in
81 a terminal input queue.
83 The maximum number of bytes in a filename,
84 not including a terminating null character.
86 The maximum number of bytes in a pathname,
87 including the terminating null character.
89 The maximum number of bytes which will be written atomically to a pipe.
90 .It Li _PC_CHOWN_RESTRICTED
91 Return 1 if appropriate privileges are required for the
93 system call, otherwise 0.
95 Return 0 if filenames longer than
97 are silently truncated, or non-zero if an error is generated when
101 Returns the terminal character disabling value.
103 Returns 1 if synchronized I/O is supported, otherwise 0.
104 .It Li _PC_FILESIZEBITS
105 If the maximum size file that could ever exist on the mounted file system is
107 then the returned value is 2 plus the floor of the base 2 logarithm of
109 .It Li _PC_SYMLINK_MAX
110 The maximum number of bytes in a symbolic link.
111 .It Li _PC_2_SYMLINKS
112 When referring to a directory the system supports the creation of symbolic
113 links within that directory; for nondirectory files, the meaning of
122 is not successful, \-1 is returned and
124 is set appropriately.
125 Otherwise, if the variable is associated with functionality that does
126 not have a limit in the system, \-1 is returned and
129 Otherwise, the current variable value is returned.
131 If any of the following conditions occur, the
135 functions shall return \-1 and set
137 to the corresponding value.
142 argument is invalid, or
143 the implementation does not support an association of the variable
144 name with the associated file.
149 .Bl -tag -width ENAMETOOLONGAA
151 Search permission is denied for a component of the path prefix.
153 An I/O error occurred while reading from or writing to the file system.
155 Too many symbolic links were encountered in translating the pathname.
156 .It Bq Er ENAMETOOLONG
157 A component of a pathname exceeded
159 characters, or an entire path name exceeded
163 The named file does not exist.
165 A component of the path prefix is not a directory.
170 .Bl -tag -width [EFAULT]
173 is not a valid open file descriptor.
175 An I/O error occurred while reading from or writing to the file system.
191 functions first appeared in