From 0068ad3aa82629107946ecd2f9a84e2ac02d2cfc Mon Sep 17 00:00:00 2001 From: Marco Conte Date: Sun, 15 Dec 2019 10:35:11 +0000 Subject: [PATCH] add linux target for setfsuid and setfsgid --- src/unistd.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/unistd.rs b/src/unistd.rs index 25cff4a791..cfb2e8d626 100644 --- a/src/unistd.rs +++ b/src/unistd.rs @@ -1401,6 +1401,7 @@ pub fn setgid(gid: Gid) -> Result<()> { /// Set the user identity used for filesystem checks /// /// See also [setfsuid(2)](http://man7.org/linux/man-pages/man2/setfsuid.2.html) +#[cfg(target_os = "linux")] #[inline] pub fn setfsuid(uid: Uid) -> Result<()> { let res = unsafe { libc::setfsuid(uid.into()) }; @@ -1411,6 +1412,7 @@ pub fn setfsuid(uid: Uid) -> Result<()> { /// Set the group identity used for filesystem checks /// /// See also [setfsgid(2)](http://man7.org/linux/man-pages/man2/setfsgid.2.html) +#[cfg(target_os = "linux")] #[inline] pub fn setfsgid(gid: Gid) -> Result<()> { let res = unsafe { libc::setfsgid(gid.into()) };