summaryrefslogtreecommitdiff
path: root/src/fcntl.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-04-08 04:26:10 +0000
committerGitHub <noreply@github.com>2020-04-08 04:26:10 +0000
commitb5ee61037886bcbaea6078e2bec9b6709549926a (patch)
tree86c9dcb50f50a54d63b918b9dbdcd7bfbd8a1914 /src/fcntl.rs
parent5c8cdd005270557ceb91cdafc1eca7c971ee9219 (diff)
parentf7f1d09ae2b73131c18e1eb9a9f8bbce65eafb16 (diff)
downloadnix-b5ee61037886bcbaea6078e2bec9b6709549926a.zip
Merge #1195
1195: Implement open file descriptor locks in fcntl r=asomers a=andrenth Hello This PR updates libc to 0.2.68, which adds the `F_OFD_*` fcntl commands, and uses them in `nix::fcntl::fcntl`. Co-authored-by: Andre Nathan <andre@digirati.com.br>
Diffstat (limited to 'src/fcntl.rs')
-rw-r--r--src/fcntl.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/fcntl.rs b/src/fcntl.rs
index 773d7991..1dddee73 100644
--- a/src/fcntl.rs
+++ b/src/fcntl.rs
@@ -286,6 +286,12 @@ pub fn fcntl(fd: RawFd, arg: FcntlArg) -> Result<c_int> {
F_SETLKW(flock) => libc::fcntl(fd, libc::F_SETLKW, flock),
F_GETLK(flock) => libc::fcntl(fd, libc::F_GETLK, flock),
#[cfg(any(target_os = "android", target_os = "linux"))]
+ F_OFD_SETLK(flock) => libc::fcntl(fd, libc::F_OFD_SETLK, flock),
+ #[cfg(any(target_os = "android", target_os = "linux"))]
+ F_OFD_SETLKW(flock) => libc::fcntl(fd, libc::F_OFD_SETLKW, flock),
+ #[cfg(any(target_os = "android", target_os = "linux"))]
+ F_OFD_GETLK(flock) => libc::fcntl(fd, libc::F_OFD_GETLK, flock),
+ #[cfg(any(target_os = "android", target_os = "linux"))]
F_ADD_SEALS(flag) => libc::fcntl(fd, libc::F_ADD_SEALS, flag.bits()),
#[cfg(any(target_os = "android", target_os = "linux"))]
F_GET_SEALS => libc::fcntl(fd, libc::F_GET_SEALS),
@@ -295,8 +301,6 @@ pub fn fcntl(fd: RawFd, arg: FcntlArg) -> Result<c_int> {
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!()
}
};