diff options
author | Kamal Marhubi <kamal@marhubi.com> | 2017-02-27 22:37:28 -0500 |
---|---|---|
committer | Kamal Marhubi <kamal@marhubi.com> | 2017-02-27 22:47:12 -0500 |
commit | b81229d4ba0cd6edea03a0a2cde9b565ba9b0038 (patch) | |
tree | 4fd4021f1e4b8556bcbde7df63c9f065bfd8dd70 /src/fcntl.rs | |
parent | 06d9b04180288de9906afd8018dd19a403e1877d (diff) | |
download | nix-b81229d4ba0cd6edea03a0a2cde9b565ba9b0038.zip |
fcntl: Support getting and setting pipe size on Linux
Diffstat (limited to 'src/fcntl.rs')
-rw-r--r-- | src/fcntl.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/fcntl.rs b/src/fcntl.rs index 9a3c601d..64e9fb60 100644 --- a/src/fcntl.rs +++ b/src/fcntl.rs @@ -48,6 +48,10 @@ pub enum FcntlArg<'a> { F_GET_SEALS, #[cfg(any(target_os = "macos", target_os = "ios"))] F_FULLFSYNC, + #[cfg(any(target_os = "linux", target_os = "android"))] + F_GETPIPE_SZ, + #[cfg(any(target_os = "linux", target_os = "android"))] + F_SETPIPE_SZ(libc::c_int), // TODO: Rest of flags } @@ -74,6 +78,10 @@ pub fn fcntl(fd: RawFd, arg: FcntlArg) -> Result<c_int> { #[cfg(any(target_os = "macos", target_os = "ios"))] F_FULLFSYNC => libc::fcntl(fd, libc::F_FULLFSYNC), #[cfg(any(target_os = "linux", target_os = "android"))] + F_GETPIPE_SZ => libc::fcntl(fd, libc::F_GETPIPE_SZ), + #[cfg(any(target_os = "linux", target_os = "android"))] + F_SETPIPE_SZ(size) => libc::fcntl(fd, libc::F_SETPIPE_SZ, size), + #[cfg(any(target_os = "linux", target_os = "android"))] _ => unimplemented!() } }; |