[PATCH] Only the posixaio engine needs to link against -lrt
[fio.git] / os-linux.h
index 4c54c8ccc6f0991af3dfbf4edd16d3267c45e0ea..752d17e1e84db3af75726560574aaa20b712a8e1 100644 (file)
@@ -84,6 +84,18 @@ enum {
 #define BLKGETSIZE64   _IOR(0x12,114,size_t)
 #endif
 
+#ifndef BLKFLSBUF
+#define BLKFLSBUF      _IO(0x12,97)
+#endif
+
+static inline int blockdev_invalidate_cache(int fd)
+{
+       if (!ioctl(fd, BLKFLSBUF))
+               return 0;
+
+       return errno;
+}
+
 static inline int blockdev_size(int fd, unsigned long long *bytes)
 {
        if (!ioctl(fd, BLKGETSIZE64, bytes))