summaryrefslogtreecommitdiff
path: root/os/os-netbsd.h
diff options
context:
space:
mode:
authorJens Axboe <jaxboe@fusionio.com>2011-07-12 23:49:16 +0200
committerJens Axboe <jaxboe@fusionio.com>2011-07-12 23:49:16 +0200
commitb9afd959477dbaee2d331b63b0a252bd8aaf6206 (patch)
tree136ec4cfe3f9f6f2f7f18d51c0d7d64fe547b718 /os/os-netbsd.h
parente8d588e4d31f9d1e93b14499d23760d1d3d2db6b (diff)
downloadfio-b9afd959477dbaee2d331b63b0a252bd8aaf6206.tar.gz
fio-b9afd959477dbaee2d331b63b0a252bd8aaf6206.tar.bz2
gettid() for NetBSD
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'os/os-netbsd.h')
-rw-r--r--os/os-netbsd.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/os/os-netbsd.h b/os/os-netbsd.h
index 8f61ec54..7f5f4846 100644
--- a/os/os-netbsd.h
+++ b/os/os-netbsd.h
@@ -19,6 +19,7 @@
#define FIO_HAVE_FDATASYNC
#define FIO_USE_GENERIC_BDEV_SIZE
#define FIO_USE_GENERIC_RAND
+#define FIO_HAVE_GETTID
#undef FIO_HAVE_CPU_AFFINITY /* XXX notyet */
@@ -45,6 +46,14 @@ static inline unsigned long long os_phys_mem(void)
return mem;
}
+static inline int gettid(void)
+{
+ long lwpid;
+
+ thr_self(&lwpid);
+ return (int) lwpid;
+}
+
#ifdef MADV_FREE
#define FIO_MADV_FREE MADV_FREE
#endif