change os_trim() prototype not to use int fd
[fio.git] / os / os-freebsd.h
index 3d7dbe6573b8a8841e4cdcd0f38db22e8c06448a..4a7cdeb7daaf2cef234c5a0c0ec551c7e72e4dad 100644 (file)
@@ -6,6 +6,7 @@
 #include <errno.h>
 #include <sys/sysctl.h>
 #include <sys/disk.h>
+#include <sys/endian.h>
 #include <sys/thr.h>
 #include <sys/socket.h>
 #include <sys/param.h>
 #define FIO_HAVE_CPU_AFFINITY
 #define FIO_HAVE_SHM_ATTACH_REMOVED
 
-#if _POSIX_THREAD_PROCESS_SHARED > 0
-#define FIO_HAVE_PSHARED_MUTEX
-#endif
-
 #define OS_MAP_ANON            MAP_ANON
 
 #define fio_swap16(x)  bswap16(x)
@@ -120,7 +117,7 @@ static inline unsigned long long get_fs_free_size(const char *path)
        return ret;
 }
 
-static inline int os_trim(int fd, unsigned long long start,
+static inline int os_trim(struct fio_file *f, unsigned long long start,
                          unsigned long long len)
 {
        off_t range[2];
@@ -128,7 +125,7 @@ static inline int os_trim(int fd, unsigned long long start,
        range[0] = start;
        range[1] = len;
 
-       if (!ioctl(fd, DIOCGDELETE, range))
+       if (!ioctl(f->fd, DIOCGDELETE, range))
                return 0;
 
        return errno;