1 .\" $NetBSD: pathconf.2,v 1.27 2010/07/26 12:30:16 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:
75 .Bl -tag -width "123456"
77 The maximum file link count.
79 The maximum number of bytes in terminal canonical input line.
81 The minimum maximum number of bytes for which space is available in
82 a terminal input queue.
84 The maximum number of bytes in a filename,
85 not including a terminating null character.
87 The maximum number of bytes in a pathname,
88 including the terminating null character.
90 The maximum number of bytes which will be written atomically to a pipe.
91 .It Li _PC_CHOWN_RESTRICTED
92 Return 1 if appropriate privileges are required for the
94 system call, otherwise 0.
96 Return 0 if filenames longer than
98 are silently truncated, or non-zero if an error is generated when
102 Returns the terminal character disabling value.
104 Returns 1 if synchronized I/O is supported, otherwise 0.
105 .It Li _PC_FILESIZEBITS
106 If the maximum size file that could ever exist on the mounted file system is
108 then the returned value is 2 plus the floor of the base 2 logarithm of
110 .It Li _PC_SYMLINK_MAX
111 The maximum number of bytes in a symbolic link.
112 .It Li _PC_2_SYMLINKS
113 When referring to a directory the system supports the creation of symbolic
114 links within that directory; for nondirectory files, the meaning of
123 is not successful, \-1 is returned and
125 is set appropriately.
126 Otherwise, if the variable is associated with functionality that does
127 not have a limit in the system, \-1 is returned and
130 Otherwise, the current variable value is returned.
132 If any of the following conditions occur, the
136 functions shall return \-1 and set
138 to the corresponding value.
143 argument is invalid, or
144 the implementation does not support an association of the variable
145 name with the associated file.
150 .Bl -tag -width ENAMETOOLONGAA
152 Search permission is denied for a component of the path prefix.
154 An I/O error occurred while reading from or writing to the file system.
156 Too many symbolic links were encountered in translating the pathname.
157 .It Bq Er ENAMETOOLONG
158 A component of a pathname exceeded 255 characters,
159 or an entire path name exceeded 1023 characters.
161 The named file does not exist.
163 A component of the path prefix is not a directory.
168 .Bl -tag -width [EFAULT]
171 is not a valid open file descriptor.
173 An I/O error occurred while reading from or writing to the file system.
189 functions first appeared in