Skip to contentSkip to conversation

netbsd: fix gettid

PATCH In review Roger Pau Monne 2 participants 4 messages Sep 26, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 netbsd: fix gettid

---
 os/os-netbsd.h |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)
os/os-netbsd.h +2 -5
index aef578e..de687ba 100644
@@ -4,8 +4,8 @@
 #define	FIO_OS	os_netbsd
 
 #include <errno.h>
+#include <lwp.h>
 #include <sys/param.h>
-#include <sys/thr.h>
 #include <sys/endian.h>
 /* XXX hack to avoid confilcts between rbtree.h and <sys/rb.h> */
 #define	rb_node	_rb_node
@@ -63,10 +63,7 @@ static inline unsigned long long os_phys_mem(void)
 
 static inline int gettid(void)
 {
-	long lwpid;
-
-	thr_self(&lwpid);
-	return (int) lwpid;
+	return (int) _lwp_self();
 }
 
 #ifdef MADV_FREE
Signature · 1 line
1.7.7.5 (Apple Git-26)
#2 lore raw
Quoted 5 lines · Jens Axboe
Quoted 1 line · Roger Pau Monne

Thanks Roger. I'm assuming you are using fio on NetBSD so I can consider this tested? It's applied.

Yes, at least it compiles now, and it works to some degree, but I will probably send more patches to fix remaining bits.

Thanks.

#3 lore raw
Quoted 9 lines · Roger Pau Monne
Quoted 5 lines · Jens Axboe
Quoted 1 line · Roger Pau Monne

Thanks Roger. I'm assuming you are using fio on NetBSD so I can consider this tested? It's applied.

Yes, at least it compiles now, and it works to some degree, but I will probably send more patches to fix remaining bits.

Thanks, that would be great. It's hard for me to get good testing on the more esoteric platforms, so any help there is greatly appreciated.

Signature · 1 line
Jens Axboe