Skip to content

Commit

Permalink
Add test for getsid.
Browse files Browse the repository at this point in the history
  • Loading branch information
ggriffiniii committed Feb 5, 2018
1 parent 0384e8d commit 5e99945
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/test_unistd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,14 @@ fn test_getpid() {
assert!(ppid > 0);
}

#[test]
fn test_getsid() {
let none_sid: ::libc::pid_t = getsid(None).unwrap().into();
let pid_sid: ::libc::pid_t = getsid(Some(getpid())).unwrap().into();
assert!(none_sid > 0);
assert!(none_sid == pid_sid);
}

#[cfg(any(target_os = "linux", target_os = "android"))]
mod linux_android {
use nix::unistd::gettid;
Expand Down

0 comments on commit 5e99945

Please sign in to comment.