method of defining the BLKFLSBUF and FDFLUSH ioctl's.
Also include sys/mount.h since on newer glibc's BLKFLSBUF
is defined there.
+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
#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;
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
#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