Fix "cast from pointer to integer of different size" warning on OpenBSD
[fio.git] / os / os-openbsd.h
index 3343cbdfbb18384ded0d4cfe0b145216cbf27590..9c7092c8ef4908a682323b4065d18445430bc076 100644 (file)
@@ -22,6 +22,7 @@
 #define FIO_USE_GENERIC_INIT_RANDOM_STATE
 #define FIO_HAVE_FS_STAT
 #define FIO_HAVE_GETTID
+#define FIO_HAVE_SHM_ATTACH_REMOVED
 
 #undef FIO_HAVE_CPU_AFFINITY   /* XXX notyet */
 
@@ -52,7 +53,7 @@ static inline int blockdev_size(struct fio_file *f, unsigned long long *bytes)
 
 static inline int blockdev_invalidate_cache(struct fio_file *f)
 {
-       return EINVAL;
+       return ENOTSUP;
 }
 
 static inline unsigned long long os_phys_mem(void)
@@ -67,7 +68,7 @@ static inline unsigned long long os_phys_mem(void)
 
 static inline int gettid(void)
 {
-       return (int) pthread_self();
+       return (int)(intptr_t) pthread_self();
 }
 
 static inline unsigned long long get_fs_free_size(const char *path)
@@ -87,4 +88,12 @@ static inline unsigned long long get_fs_free_size(const char *path)
 #define FIO_MADV_FREE  MADV_FREE
 #endif
 
+static inline int shm_attach_to_open_removed(void)
+{
+       /*
+        * XXX: Return 1 if >= OpenBSD 5.1 according to 97900ebf.
+        */
+       return 0;
+}
+
 #endif