1 /* Copyright (C) 1991,1995,1996,1998,2000,2001 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public License as
6 published by the Free Software Foundation; either version 2 of the
7 License, or (at your option) any later version.
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public
15 License along with the GNU C Library; see the file COPYING.LIB. If not,
16 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 Boston, MA 02111-1307, USA. */
24 #include <sys/statfs.h>
25 #include <sys/statvfs.h>
28 /* Get file-specific information about PATH. */
30 __pathconf (const char *path
, int name
)
69 int save_errno
= errno
;
71 if (__statfs (path
, &buf
) < 0)
82 #ifdef _STATFS_F_NAMELEN
85 # ifdef _STATFS_F_NAME_MAX
86 return buf
.f_name_max
;
111 case _PC_CHOWN_RESTRICTED
:
112 #ifdef _POSIX_CHOWN_RESTRICTED
113 return _POSIX_CHOWN_RESTRICTED
;
119 #ifdef _POSIX_NO_TRUNC
120 return _POSIX_NO_TRUNC
;
126 #ifdef _POSIX_VDISABLE
127 return _POSIX_VDISABLE
;
133 #ifdef _POSIX_SYNC_IO
134 return _POSIX_SYNC_IO
;
140 #ifdef _POSIX_ASYNC_IO
141 return _POSIX_ASYNC_IO
;
147 #ifdef _POSIX_PRIO_IO
148 return _POSIX_PRIO_IO
;
153 case _PC_SOCK_MAXBUF
:
160 case _PC_FILESIZEBITS
:
164 /* We let platforms with larger file sizes overwrite this value. */
168 case _PC_REC_INCR_XFER_SIZE
:
169 /* XXX It is not entirely clear what the limit is supposed to do.
170 What is incremented? */
173 case _PC_REC_MAX_XFER_SIZE
:
174 /* XXX It is not entirely clear what the limit is supposed to do.
175 In general there is no top limit of the number of bytes which
176 case be transported at once. */
179 case _PC_REC_MIN_XFER_SIZE
:
181 /* XXX It is not entirely clear what the limit is supposed to do.
182 I assume this is the block size of the filesystem. */
185 if (__statvfs64 (path
, &sv
) < 0)
190 case _PC_REC_XFER_ALIGN
:
192 /* XXX It is not entirely clear what the limit is supposed to do.
193 I assume that the number should reflect the minimal block
197 if (__statvfs64 (path
, &sv
) < 0)
202 case _PC_ALLOC_SIZE_MIN
:
204 /* XXX It is not entirely clear what the limit is supposed to do.
205 I assume that the number should reflect the minimal block
209 if (__statvfs64 (path
, &sv
) < 0)
214 case _PC_SYMLINK_MAX
:
215 /* In general there are no limits. If a system has one it should
216 overwrite this case. */
222 weak_alias (__pathconf
, pathconf
)