Whamcloud - gitweb
e2fsck/flushb.c and lib/ext2fs/flushb.c: Use platform independent
authorTheodore Ts'o <tytso@mit.edu>
Sat, 23 Jun 2001 01:01:17 +0000 (21:01 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sat, 23 Jun 2001 01:01:17 +0000 (21:01 -0400)
method of defining the BLKFLSBUF and FDFLUSH ioctl's.
Also include sys/mount.h since on newer glibc's BLKFLSBUF
is defined there.

e2fsck/ChangeLog
e2fsck/flushb.c
lib/ext2fs/ChangeLog
lib/ext2fs/flushb.c

index 782aec7..4a9aa9f 100644 (file)
@@ -1,3 +1,9 @@
+2001-06-22  Theodore Tso  <tytso@valinux.com>
+
+       * flushb.c: Use platform independent method of defining the
+               BLKFLSBUF ioctl.  Also include sys/mount.h since on newer
+               platforms BLKFLSBUF is defined there.
+
 2001-06-19  Theodore Tso  <tytso@valinux.com>
 
        * super.c (release_inode_blocks): Don't try to release the blocks
index 16389b2..d56b41c 100644 (file)
 #include <stdlib.h>
 #include <fcntl.h>
 #include <sys/ioctl.h>
+#include <sys/mount.h>
 #include "../misc/nls-enable.h"
 
-/* For Linux/i386, define BLKFLSBUF */
-#if (!defined(BLKFLSBUF) && defined(__i386__))
-#define BLKFLSBUF  0x1261      /* flush buffer cache */
+/* For Linux, define BLKFLSBUF if necessary */
+#if (!defined(BLKFLSBUF) && defined(__linux__))
+#define BLKFLSBUF      _IO(0x12,97)    /* flush buffer cache */
 #endif
 
 const char *progname;
index 38e026a..00ee60c 100644 (file)
@@ -1,5 +1,9 @@
 2001-06-22  Theodore Tso  <tytso@valinux.com>
 
+       * flushb.c: Use platform independent method of defining the
+               BLKFLSBUF and FDFLUSH ioctl's.  Also include sys/mount.h
+               since on newer glibc's BLKFLSBUF is defined there.
+
        * bitops.h: The C language versions of ext2fs_swab16/32 need to be
                included if EXT2FS_ENABLE_SWAPFS is defined, since we need
                to support byte swapping even if we don't support the
index 03f48a6..282dca3 100644 (file)
 #if HAVE_SYS_IOCTL_H
 #include <sys/ioctl.h>
 #endif
+#if HAVE_SYS_MOUNT_H
+#include <sys/mount.h>         /* This may define BLKFLSBUF */
+#endif
 
 #include "ext2_fs.h"
 #include "ext2fs.h"
 
 /*
- * For Linux/i386, define BLKFLSBUF and FDFLUSH if necessary, since 
- * no portable header file does so for us.  This really should be
- * fixed in the glibc header files.  Until then....
+ * For Linux, define BLKFLSBUF and FDFLUSH if necessary, since 
+ * not all portable header file does so for us.  This really should be
+ * fixed in the glibc header files.  (Recent glibcs appear to define
+ * BLKFLSBUF in sys/mount.h, but FDFLUSH still doesn't seem to be
+ * defined anywhere portable.)  Until then....
  */
-#if (defined(__i386__) && defined(__linux__))
+#ifdef __linux__
 #ifndef BLKFLSBUF
-#define BLKFLSBUF      0x1261  /* flush buffer cache */
+#define BLKFLSBUF      _IO(0x12,97)    /* flush buffer cache */
 #endif
 #ifndef FDFLUSH
-#define FDFLUSH                0x024b  /* flush floppy disk */
+#define FDFLUSH                _IO(2,0x4b)     /* flush floppy disk */
 #endif
 #endif