2002-10-16 Roland McGrath <roland@redhat.com>
[glibc.git] / sysdeps / unix / sysv / linux / alpha / fpathconf.c
bloba8a24de1f8fc1ce292ae4dda68b26b119aefa6f5
1 /* Get file-specific information about a descriptor. Linux/Alpha version.
2 Copyright (C) 1991,95,96,98,99,2000,2001,2002 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, write to the Free
17 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
18 02111-1307 USA. */
20 #include <unistd.h>
21 #include <sys/statfs.h>
24 static long int linux_fpathconf (int fd, int name);
26 /* Define this first, so it can be inlined. */
27 #define __fpathconf static linux_fpathconf
28 #include <sysdeps/unix/sysv/linux/fpathconf.c>
31 /* Get file-specific information about FD. */
32 long int
33 __pathconf (int fd, int name)
35 if (name == _PC_FILESIZEBITS)
37 /* Test whether this is on a ext2 or UFS filesystem which
38 support large files. */
39 struct statfs fs;
41 if (__fstatfs (fd, &fs) < 0
42 || (fs.f_type != EXT2_SUPER_MAGIC
43 && fs.f_type != UFS_MAGIC
44 && fs.f_type != UFS_CIGAM))
45 return 32;
47 /* This filesystem supported files >2GB. */
48 return 64;
51 return linux_fpathconf (fd, name);