1 /* Linux specific extensions to pathconf.
2 Copyright (C) 1991, 1995, 1996, 1998 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"
26 static long int posix_pathconf (const char *path
, int name
);
29 /* Get file-specific information about descriptor FD. */
31 __pathconf (path
, name
)
35 if (name
== _PC_LINK_MAX
)
39 /* Determine the filesystem type. */
40 if (__statfs (path
, &fsbuf
) < 0)
41 /* not possible, return the default value. */
46 case EXT2_SUPER_MAGIC
:
49 case MINIX_SUPER_MAGIC
:
50 case MINIX_SUPER_MAGIC2
:
51 return MINIX_LINK_MAX
;
53 case MINIX2_SUPER_MAGIC
:
54 case MINIX2_SUPER_MAGIC2
:
55 return MINIX2_LINK_MAX
;
57 case XENIX_SUPER_MAGIC
:
58 return XENIX_LINK_MAX
;
60 case SYSV4_SUPER_MAGIC
:
61 case SYSV2_SUPER_MAGIC
:
76 return posix_pathconf (path
, name
);
79 #define __pathconf static posix_pathconf
80 #include <sysdeps/posix/pathconf.c>