@@ -63,13 +63,15 @@ fsTypeSupportsJournaling path =
6363#elif linux_HOST_OS
6464import Foreign
6565--Linux cannot report journaling, so we just check the filesystem type as a proxy
66−#include <sys/vfs.h>
67−#include <linux/magic.h>
6866type CStatFS = ()
6967foreign import ccall unsafe "sys/vfs.h statfs"
7068 c_statfs :: CString -> Ptr CStatFS -> IO CInt
7169
72−type CFSType = #{type __SWORD_TYPE}
70+#if sizeof(int) == 8
71+type CFSType = Word64
72+#else
73+type CFSType = Word32
74+#endif
7375
7476fsTypeSupportsJournaling :: FilePath -> IO Bool
7577fsTypeSupportsJournaling path = do
@@ -78,16 +80,12 @@ fsTypeSupportsJournaling path = do
7880 withForeignPtr struct_statfs $ \ptr_statfs -> do
7981 throwErrnoIfMinus1_ "statfs" (c_statfs c_path ptr_statfs)
8082 cfstype <- peekByteOff ptr_statfs 0 :: IO CFSType
81− let journaledFS = [#{const EXT3_SUPER_MAGIC},
82− #{const EXT4_SUPER_MAGIC},
83− #{ifdef NTFS_SB_MAGIC
84− NTFS_SB_MAGIC,
85− #endif}
86− #{const REISERFS_SUPER_MAGIC},
87− #{ifdef XFS_SUPER_MAGIC
88− XFS_SUPER_MAGIC,
89− #endif}
90− 0]
83+ let journaledFS = [0xEF53, --EXT3+4
84+ 0x5346544e, --NTFS
85+ 0x52654973, --REISERFS
86+ 0x58465342, --XFS
87+ 0x3153464a --JFS
88+ ]
9189 pure (elem cfstype journaledFS)
9290#endif
9391