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()) };