diff options
author | Alan Somers <asomers@gmail.com> | 2019-06-02 21:04:48 -0600 |
---|---|---|
committer | Alan Somers <asomers@gmail.com> | 2019-06-02 21:43:13 -0600 |
commit | 974320d09fbd1fae79da537383c2144ed9aa4967 (patch) | |
tree | 41b69b18dda3f97b84d16cc09d432e774245d50b | |
parent | 3bfd0daef18870bdaea83600fa1ff14b0aefda3d (diff) | |
download | nix-974320d09fbd1fae79da537383c2144ed9aa4967.zip |
Fix test_pthread_self on musl
On musl, pthread_t is a pointer type.
-rw-r--r-- | test/sys/test_pthread.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/sys/test_pthread.rs b/test/sys/test_pthread.rs index a4f02772..7e6baea0 100644 --- a/test/sys/test_pthread.rs +++ b/test/sys/test_pthread.rs @@ -1,5 +1,14 @@ use nix::sys::pthread::*; +use std::ptr; +#[cfg(target_env = "musl")] +#[test] +fn test_pthread_self() { + let tid = pthread_self(); + assert!(tid != ptr::null_mut()); +} + +#[cfg(not(target_env = "musl"))] #[test] fn test_pthread_self() { let tid = pthread_self(); |