summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlenn Griffin <ggriffiniii@gmail.com>2018-02-05 09:30:22 -0800
committerGlenn Griffin <ggriffiniii@gmail.com>2018-02-05 09:30:22 -0800
commit5e999457689e4dabbc1720ea9ce684ef78286df0 (patch)
tree5d9749e8a8c23bf16d74f36297df5a0c36b7e379
parent0384e8dc7a71031086f9065aceb9a6f5ef571af9 (diff)
downloadnix-5e999457689e4dabbc1720ea9ce684ef78286df0.zip
Add test for getsid.
-rw-r--r--test/test_unistd.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/test_unistd.rs b/test/test_unistd.rs
index e15fec17..d0db55f6 100644
--- a/test/test_unistd.rs
+++ b/test/test_unistd.rs
@@ -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;