OSDN Git Service

8b9c454b817e4b2773cd0f20ae1b1410dec5534d
[linuxjm/LDP_man-pages.git] / original / man3 / fpathconf.3
1 .\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de)
2 .\"
3 .\" %%%LICENSE_START(VERBATIM)
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
7 .\"
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
12 .\"
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein.  The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
19 .\" professionally.
20 .\"
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" %%%LICENSE_END
24 .\"
25 .\" Modified Wed Jul 28 11:12:26 1993 by Rik Faith (faith@cs.unc.edu)
26 .\"
27 .\" FIXME Probably all of the following should be documented:
28 .\"     _PC_SYNC_IO,
29 .\"     _PC_ASYNC_IO,
30 .\"     _PC_PRIO_IO,
31 .\"     _PC_SOCK_MAXBUF,
32 .\"     _PC_FILESIZEBITS,
33 .\"     _PC_REC_INCR_XFER_SIZE,
34 .\"     _PC_REC_MAX_XFER_SIZE,
35 .\"     _PC_REC_MIN_XFER_SIZE,
36 .\"     _PC_REC_XFER_ALIGN,
37 .\"     _PC_ALLOC_SIZE_MIN,
38 .\"     _PC_SYMLINK_MAX,
39 .\"     _PC_2_SYMLINKS
40 .\"
41 .TH FPATHCONF 3  2014-03-20 "GNU" "Linux Programmer's Manual"
42 .SH NAME
43 fpathconf, pathconf \- get configuration values for files
44 .SH SYNOPSIS
45 .nf
46 .B #include <unistd.h>
47 .sp
48 .BI "long fpathconf(int " fd ", int " name );
49 .br
50 .BI "long pathconf(char *" path ", int " name );
51 .fi
52 .SH DESCRIPTION
53 .BR fpathconf ()
54 gets a value for the configuration option
55 .I name
56 for the open file descriptor
57 .IR fd .
58 .PP
59 .BR pathconf ()
60 gets a value for configuration option
61 .I name
62 for the filename
63 .IR path .
64 .PP
65 The corresponding macros defined in
66 .I <unistd.h>
67 are minimum values; if an application wants to take advantage of values
68 which may change, a call to
69 .BR fpathconf ()
70 or
71 .BR pathconf ()
72 can be made, which may yield more liberal results.
73 .PP
74 Setting
75 .I name
76 equal to one of the following constants returns the following
77 configuration options:
78 .TP
79 .B _PC_LINK_MAX
80 returns the maximum number of links to the file.
81 If
82 .I fd
83 or
84 .I path
85 refer to a directory, then the value applies to the whole directory.
86 The corresponding macro is
87 .BR _POSIX_LINK_MAX .
88 .TP
89 .B _PC_MAX_CANON
90 returns the maximum length of a formatted input line, where
91 .I fd
92 or
93 .I path
94 must refer to a terminal.
95 The corresponding macro is
96 .BR _POSIX_MAX_CANON .
97 .TP
98 .B _PC_MAX_INPUT
99 returns the maximum length of an input line, where
100 .I fd
101 or
102 .I path
103 must refer to a terminal.
104 The corresponding macro is
105 .BR _POSIX_MAX_INPUT .
106 .TP
107 .B _PC_NAME_MAX
108 returns the maximum length of a filename in the directory
109 .I path
110 or
111 .IR fd
112 that the process is allowed to create.
113 The corresponding macro is
114 .BR _POSIX_NAME_MAX .
115 .TP
116 .B _PC_PATH_MAX
117 returns the maximum length of a relative pathname when
118 .I path
119 or
120 .I fd
121 is the current working directory.
122 The corresponding macro is
123 .BR _POSIX_PATH_MAX .
124 .TP
125 .B _PC_PIPE_BUF
126 returns the size of the pipe buffer, where
127 .I fd
128 must refer to a pipe or FIFO and
129 .I path
130 must refer to a FIFO.
131 The corresponding macro is
132 .BR _POSIX_PIPE_BUF .
133 .TP
134 .B _PC_CHOWN_RESTRICTED
135 returns nonzero if the
136 .BR chown (2)
137 call may not be used on this file.
138 If
139 .I fd
140 or
141 .I path
142 refer to a directory, then this applies to all files in that
143 directory.
144 The corresponding macro is
145 .BR _POSIX_CHOWN_RESTRICTED .
146 .TP
147 .B _PC_NO_TRUNC
148 returns nonzero if accessing filenames longer than
149 .B _POSIX_NAME_MAX
150 generates an error.
151 The corresponding macro is
152 .BR _POSIX_NO_TRUNC .
153 .TP
154 .B _PC_VDISABLE
155 returns nonzero if special character processing can be disabled, where
156 .I fd
157 or
158 .I path
159 must refer to a terminal.
160 .SH RETURN VALUE
161 The limit is returned, if one exists.
162 If the system does not have a
163 limit for the requested resource, \-1 is returned, and
164 .I errno
165 is unchanged.
166 If there is an error, \-1 is returned, and
167 .I errno
168 is set to reflect the nature of the error.
169 .SH CONFORMING TO
170 POSIX.1-2001.
171 .SH NOTES
172 Files with name lengths longer than the value returned for
173 .I name
174 equal to
175 .B _PC_NAME_MAX
176 may exist in the given directory.
177 .PP
178 Some returned values may be huge; they are not suitable for allocating
179 memory.
180 .SH SEE ALSO
181 .BR getconf (1),
182 .BR open (2),
183 .BR statfs (2),
184 .BR confstr (3),
185 .BR sysconf (3)
186 .SH COLOPHON
187 This page is part of release 3.67 of the Linux
188 .I man-pages
189 project.
190 A description of the project,
191 information about reporting bugs,
192 and the latest version of this page,
193 can be found at
194 \%http://www.kernel.org/doc/man\-pages/.