1 /* Linux specific extensions to pathconf.
2 Copyright (C) 1991, 95, 96, 98, 99, 2000 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 Library General Public License as
7 published by the Free Software Foundation; either version 2 of the
8 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 Library General Public License for more details.
15 You should have received a copy of the GNU Library General Public
16 License along with the GNU C Library; see the file COPYING.LIB. If not,
17 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. */
22 #include <sys/statfs.h>
24 #include "linux_fsinfo.h"
27 /* The Linux kernel header mentioned this as a kind of generic value. */
28 #define LINUX_LINK_MAX 127
30 static long int posix_pathconf (const char *path
, int name
);
33 /* Get file-specific information about descriptor FD. */
35 __pathconf (path
, name
)
39 if (name
== _PC_LINK_MAX
)
43 /* Determine the filesystem type. */
44 if (__statfs (path
, &fsbuf
) < 0)
45 /* not possible, return the default value. */
50 case EXT2_SUPER_MAGIC
:
53 case MINIX_SUPER_MAGIC
:
54 case MINIX_SUPER_MAGIC2
:
55 return MINIX_LINK_MAX
;
57 case MINIX2_SUPER_MAGIC
:
58 case MINIX2_SUPER_MAGIC2
:
59 return MINIX2_LINK_MAX
;
61 case XENIX_SUPER_MAGIC
:
62 return XENIX_LINK_MAX
;
64 case SYSV4_SUPER_MAGIC
:
65 case SYSV2_SUPER_MAGIC
:
75 case REISERFS_SUPER_MAGIC
:
76 return REISERFS_LINK_MAX
;
79 return LINUX_LINK_MAX
;
83 return posix_pathconf (path
, name
);
86 #define __pathconf static posix_pathconf
87 #include <sysdeps/posix/pathconf.c>