Skip to content

Commit 7befc42

Browse files
committed
Fix test_pthread_self on musl
On musl, pthread_t is a pointer type.
1 parent 22b3107 commit 7befc42

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/sys/test_pthread.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
use nix::sys::pthread::*;
2+
use std::ptr;
23

4+
#[cfg(target_env = "musl")]
5+
#[test]
6+
fn test_pthread_self() {
7+
let tid = pthread_self();
8+
assert!(tid != ptr::null_mut());
9+
}
10+
11+
#[cfg(not(target_env = "musl"))]
312
#[test]
413
fn test_pthread_self() {
514
let tid = pthread_self();

0 commit comments

Comments
 (0)