about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/pathconf.h
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2002-10-18 19:03:55 +0000
committerRoland McGrath <roland@gnu.org>2002-10-18 19:03:55 +0000
commit69c708edbc722e0f51fe1f6c50ebf1ca7924eb83 (patch)
tree2e6c82d058c29088dd4fa9b461e25e1c71dbf6a1 /sysdeps/unix/sysv/linux/pathconf.h
parent2e9d4e8c883c1145bca2710e7fba83e9387c664b (diff)
downloadglibc-69c708edbc722e0f51fe1f6c50ebf1ca7924eb83.tar.gz
glibc-69c708edbc722e0f51fe1f6c50ebf1ca7924eb83.tar.xz
glibc-69c708edbc722e0f51fe1f6c50ebf1ca7924eb83.zip
* sysdeps/unix/sysv/linux/pathconf.h (statfs_link_max): Add inline.
	(statfs_filesize_max): New function.
	* sysdeps/unix/sysv/linux/linux_fsinfo.h (JFFS_SUPER_MAGIC,
	JFFS2_SUPER_MAGIC, JFS_SUPER_MAGIC, NTFS_SUPER_MAGIC,
	ROMFS_SUPER_MAGIC, UDF_SUPER_MAGIC): Define.
	* sysdeps/unix/sysv/linux/fpathconf.c (__fpathconf): Use
	statfs_filesize_max.
	* sysdeps/unix/sysv/linux/pathconf.c (__pathconf): Likewise.
	* sysdeps/unix/sysv/linux/alpha/fpathconf.c: Removed.
	* sysdeps/unix/sysv/linux/alpha/pathconf.c: Removed.
Diffstat (limited to 'sysdeps/unix/sysv/linux/pathconf.h')
-rw-r--r--sysdeps/unix/sysv/linux/pathconf.h42
1 files changed, 41 insertions, 1 deletions
diff --git a/sysdeps/unix/sysv/linux/pathconf.h b/sysdeps/unix/sysv/linux/pathconf.h
index 396563965e..b7f201d436 100644
--- a/sysdeps/unix/sysv/linux/pathconf.h
+++ b/sysdeps/unix/sysv/linux/pathconf.h
@@ -24,7 +24,7 @@
 
 /* Used like: return statfs_link_max (__statfs (name, &buf), &buf); */
 
-static long int
+static inline long int
 statfs_link_max (int result, const struct statfs *fsbuf)
 {
   if (result < 0)
@@ -74,3 +74,43 @@ statfs_link_max (int result, const struct statfs *fsbuf)
       return LINUX_LINK_MAX;
     }
 }
+
+/* Used like: return statfs_filesize_max (__statfs (name, &buf), &buf); */
+
+static inline long int
+statfs_filesize_max (int result, const struct statfs *fsbuf)
+{
+  if (result < 0)
+    {
+      if (errno == ENOSYS)
+	/* Not possible, return the default value.  */
+	return 32;
+
+      /* Some error occured.  */
+      return -1;
+    }
+
+  switch (fsbuf->f_type)
+    {
+    case EXT2_SUPER_MAGIC:
+    case UFS_MAGIC:
+    case UFS_CIGAM:
+    case REISERFS_SUPER_MAGIC:
+    case XFS_SUPER_MAGIC:
+    case SMB_SUPER_MAGIC:
+    case NTFS_SUPER_MAGIC:
+    case UDF_SUPER_MAGIC:
+    case JFS_SUPER_MAGIC:
+      return 64;
+
+    case MSDOS_SUPER_MAGIC:
+    case JFFS_SUPER_MAGIC:
+    case JFFS2_SUPER_MAGIC:
+    case NCP_SUPER_MAGIC:
+    case ROMFS_SUPER_MAGIC:
+      return 32;
+
+    default:
+      return 32;
+    }
+}