Skip to content

Commit

Permalink
add linux target for setfsuid and setfsgid
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco Conte committed Dec 15, 2019
1 parent fe4e1d0 commit 0068ad3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/unistd.rs
Expand Up @@ -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()) };
Expand All @@ -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()) };
Expand Down

0 comments on commit 0068ad3

Please sign in to comment.