diff options
author | Homu <homu@barosl.com> | 2016-03-09 00:30:52 +0900 |
---|---|---|
committer | Homu <homu@barosl.com> | 2016-03-09 00:30:52 +0900 |
commit | 1380807f6965f019dd63d61fad6570fc70eadf66 (patch) | |
tree | 18a0f849c1d7d379e4e63f0b5491138371efc819 /test | |
parent | 3f0c3e13a22379dccbe826336f1805a98cf6cecc (diff) | |
parent | ca752127ed614ee2003fda24dab1a36c28f6a800 (diff) | |
download | nix-1380807f6965f019dd63d61fad6570fc70eadf66.zip |
Auto merge of #293 - dhylands:gettid, r=kamalmarhubi
Add gettid
I tested this under linux, and I noticed that this seems to also be built for OSX. It would be appreciated if someone could test this under OSX.
I'm not familiar enough with rust to know if there is a way of integrating this without creating a sub-crate.
Diffstat (limited to 'test')
-rw-r--r-- | test/test_unistd.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/test_unistd.rs b/test/test_unistd.rs index 510f8f6c..2f361cfe 100644 --- a/test/test_unistd.rs +++ b/test/test_unistd.rs @@ -54,6 +54,17 @@ fn test_getpid() { assert!(ppid > 0); } +#[cfg(any(target_os = "linux", target_os = "android"))] +mod linux_android { + use nix::unistd::gettid; + + #[test] + fn test_gettid() { + let tid = gettid(); + assert!(tid > 0); + } +} + macro_rules! execve_test_factory( ($test_name:ident, $syscall:ident, $unix_sh:expr, $android_sh:expr) => ( #[test] |