This is the mail archive of the libc-hacker@sourceware.org mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] for BZ #1978 (statvfs)


Hi,

for BZ #1978 I added the SYSFS_MAGIC to linux_fsinfo.h and the most
common filesystem mappings to internal_statvfs.c: sysfs, reiserfs,
xfs, jfs, hpfs, devfs, iso9660, msdos and ntfs.

We still have magics in linux_fsinfo.h for which we have no mapping,
but I don't know the real used names in /proc/mounts for them.


2005-12-16  Thorsten Kukuk  <kukuk@suse.de>

	[BZ #1978]
	* sysdeps/unix/sysv/linux/internal_statvfs.c (__statvfs_getflags):
	Map more filesystem types to a string.
	* sysdeps/unix/sysv/linux/linux_fsinfo.h: Add SYSFS_MAGIC.


--- sysdeps/unix/sysv/linux/internal_statvfs.c	3 Apr 2004 17:32:18 -0000	1.13
+++ sysdeps/unix/sysv/linux/internal_statvfs.c	15 Dec 2005 18:40:55 -0000
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2003, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2003, 2004, 2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
 
@@ -71,6 +71,33 @@
     case NFS_SUPER_MAGIC:
       fsname = "nfs";
       break;
+    case SYSFS_MAGIC:
+      fsname = "sysfs";
+      break;
+    case REISERFS_SUPER_MAGIC:
+      fsname = "reiserfs";
+      break;
+    case XFS_SUPER_MAGIC:
+      fsname = "xfs";
+      break;
+    case JFS_SUPER_MAGIC:
+      fsname = "jfs";
+      break;
+    case HPFS_SUPER_MAGIC:
+      fsname = "hpfs";
+      break;
+    case DEVFS_SUPER_MAGIC:
+      fsname = "devfs";
+      break;
+    case ISOFS_SUPER_MAGIC:
+      fsname = "iso9660";
+      break;
+    case MSDOS_SUPER_MAGIC:
+      fsname = "msdos";
+      break;
+    case NTFS_SUPER_MAGIC:
+      fsname = "ntfs";
+      break;
     }
 
   FILE *mtab = __setmntent ("/proc/mounts", "r");
--- sysdeps/unix/sysv/linux/linux_fsinfo.h	17 Sep 2003 00:48:25 -0000	1.14
+++ sysdeps/unix/sysv/linux/linux_fsinfo.h	15 Dec 2005 18:40:55 -0000
@@ -1,5 +1,5 @@
 /* Constants from kernel header for various FSes.
-   Copyright (C) 1998,1999,2000,2001,2002,2003 Free Software Foundation, Inc.
+   Copyright (C) 1998,1999,2000,2001,2002,2003,2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -135,6 +135,9 @@
 /* Constants that identify the `vxfs' filesystem.  */
 #define VXFS_SUPER_MAGIC	0xa501fcf5
 
+/* Constants that identify the `sysfs´ filesystem.  */
+#define SYSFS_MAGIC		0x62656572
+
 /* Maximum link counts.  */
 #define COH_LINK_MAX		10000
 #define EXT2_LINK_MAX		32000

-- 
Thorsten Kukuk         http://www.suse.de/~kukuk/      kukuk@suse.de
SUSE LINUX Products GmbH       Maxfeldstr. 5       D-90409 Nuernberg
--------------------------------------------------------------------    
Key fingerprint = A368 676B 5E1B 3E46 CFCE  2D97 F8FD 4E23 56C6 FB4B


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]