summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamal Marhubi <kamal@marhubi.com>2016-03-17 14:29:00 -0400
committerKamal Marhubi <kamal@marhubi.com>2016-03-18 01:43:59 -0400
commitb43118cb981918a2d8227d59cba9d21ee38af899 (patch)
treeabba49194027597380fb1b088626a1303ace51e1
parentfa161aec169c05e48bd2ef0ec3a6ad294de0bb70 (diff)
downloadrust-libc-b43118cb981918a2d8227d59cba9d21ee38af899.tar.gz
linux: Add missing Linux-specific fcntls
Also move F_DUPFD_CLOEXEC up a level as it is available on Android. This commit leaves file sealing related fcntls and bitflag constants out, as they are defined in `linux/fcntl.h` rather than `fcntl.h`. They can be included once an approach for verification has been figured out. See #235 for more detail.
-rw-r--r--src/unix/notbsd/linux/mod.rs2
-rw-r--r--src/unix/notbsd/mod.rs10
2 files changed, 10 insertions, 2 deletions
diff --git a/src/unix/notbsd/linux/mod.rs b/src/unix/notbsd/linux/mod.rs
index ea0b462fa9..28de796e9c 100644
--- a/src/unix/notbsd/linux/mod.rs
+++ b/src/unix/notbsd/linux/mod.rs
@@ -315,8 +315,6 @@ pub const RTLD_NOW: ::c_int = 0x2;
pub const TCP_MD5SIG: ::c_int = 14;
-pub const F_DUPFD_CLOEXEC: ::c_int = 1030;
-
pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t {
__align: [],
size: [0; __SIZEOF_PTHREAD_MUTEX_T],
diff --git a/src/unix/notbsd/mod.rs b/src/unix/notbsd/mod.rs
index 826e57536f..d9d2013178 100644
--- a/src/unix/notbsd/mod.rs
+++ b/src/unix/notbsd/mod.rs
@@ -161,6 +161,16 @@ pub const F_SETFD: ::c_int = 2;
pub const F_GETFL: ::c_int = 3;
pub const F_SETFL: ::c_int = 4;
+// Linux-specific fcntls
+pub const F_SETLEASE: ::c_int = 1024;
+pub const F_GETLEASE: ::c_int = 1025;
+pub const F_NOTIFY: ::c_int = 1026;
+pub const F_DUPFD_CLOEXEC: ::c_int = 1030;
+pub const F_SETPIPE_SZ: ::c_int = 1031;
+pub const F_GETPIPE_SZ: ::c_int = 1032;
+
+// TODO(#235): Include file sealing fcntls once we have a way to verify them.
+
pub const SIGTRAP: ::c_int = 5;
pub const PTHREAD_CREATE_JOINABLE: ::c_int = 0;