fio: refactor fallocate defines
[fio.git] / os / os.h
diff --git a/os/os.h b/os/os.h
index 1d400c8f0e303fc3420a5abc40e4a4c0c9955796..2e1552914cd2fa9593230e14e6e68edeeafcc02c 100644 (file)
--- a/os/os.h
+++ b/os/os.h
@@ -361,4 +361,16 @@ static inline int shm_attach_to_open_removed(void)
 }
 #endif
 
+#ifndef FIO_HAVE_NATIVE_FALLOCATE
+static inline bool fio_fallocate(struct fio_file *f, uint64_t offset, uint64_t len)
+{
+       errno = ENOSYS;
+       return false;
+}
+#endif
+
+#if defined(CONFIG_POSIX_FALLOCATE) || defined(FIO_HAVE_NATIVE_FALLOCATE)
+# define FIO_HAVE_ANY_FALLOCATE
+#endif
+
 #endif