summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2018-12-13 09:34:16 -0600
committerGitHub <noreply@github.com>2018-12-13 09:34:16 -0600
commited8309bc03ba32c9f407d1800ad6d51ade19cdb0 (patch)
tree980fcea6a4f245018b40d52ff83ebab8429a9cfb
parentc66221d07d96e93f60636ee0eeed770d5eda4761 (diff)
parentdf277e295b2e95d8d45270c44afb5c7837eef8cf (diff)
downloadrust-libc-ed8309bc03ba32c9f407d1800ad6d51ade19cdb0.tar.gz
Merge pull request #1174 from tklauser/mfd-hugetlb
Add MFD_HUGETLB const for linux
-rw-r--r--libc-test/build.rs4
-rw-r--r--src/unix/notbsd/android/mod.rs1
-rw-r--r--src/unix/notbsd/linux/mod.rs1
3 files changed, 6 insertions, 0 deletions
diff --git a/libc-test/build.rs b/libc-test/build.rs
index 460eb7241d..e6c9c7907d 100644
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -652,6 +652,10 @@ fn main() {
"BOTHER" => true,
"MFD_CLOEXEC" | "MFD_ALLOW_SEALING" if !mips && musl => true,
+ // MFD_HUGETLB is not available in some older libc versions on the CI builders. On the
+ // x86_64 and i686 builders it seems to be available for all targets, so at least test
+ // it there.
+ "MFD_HUGETLB" if !(x86_64 || i686) || musl => true,
"DT_FIFO" | "DT_CHR" | "DT_DIR" | "DT_BLK" | "DT_REG"
| "DT_LNK" | "DT_SOCK"
diff --git a/src/unix/notbsd/android/mod.rs b/src/unix/notbsd/android/mod.rs
index 70052e1966..31e0c44db4 100644
--- a/src/unix/notbsd/android/mod.rs
+++ b/src/unix/notbsd/android/mod.rs
@@ -1056,6 +1056,7 @@ pub const O_TMPFILE: ::c_int = 0o20000000 | O_DIRECTORY;
pub const MFD_CLOEXEC: ::c_uint = 0x0001;
pub const MFD_ALLOW_SEALING: ::c_uint = 0x0002;
+pub const MFD_HUGETLB: ::c_uint = 0x0004;
// linux/netfilter.h
pub const NF_DROP: ::c_int = 0;
diff --git a/src/unix/notbsd/linux/mod.rs b/src/unix/notbsd/linux/mod.rs
index 1aeceb1a40..b8da914a8d 100644
--- a/src/unix/notbsd/linux/mod.rs
+++ b/src/unix/notbsd/linux/mod.rs
@@ -1320,6 +1320,7 @@ pub const CMSPAR: ::tcflag_t = 0o10000000000;
pub const MFD_CLOEXEC: ::c_uint = 0x0001;
pub const MFD_ALLOW_SEALING: ::c_uint = 0x0002;
+pub const MFD_HUGETLB: ::c_uint = 0x0004;
// these are used in the p_type field of Elf32_Phdr and Elf64_Phdr, which has
// the type Elf32Word and Elf64Word respectively. Luckily, both of those are u32