summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2017-10-19 14:17:57 +0000
committerbors <bors@rust-lang.org>2017-10-19 14:17:57 +0000
commit9a9f71e73ecb36fab178695619a773a4696650f2 (patch)
tree51c885abe7dd5b1199d3e4d0f9833a57587d5c12
parent2ca5bc5275a95d94a09e7cd0d1b5f0e7f0de1f3a (diff)
parent6d55c2496df043f8f631b9b14e69fd5c5e3d4e97 (diff)
downloadrust-libc-9a9f71e73ecb36fab178695619a773a4696650f2.tar.gz
Auto merge of #711 - Susurrus:termios2, r=alexcrichton
Add BOTHER & termios2 to Android & Linux This should be the same for both the struct and the constant across all Linux/Android platforms, but we'll see!
-rw-r--r--libc-test/build.rs20
-rw-r--r--src/unix/notbsd/android/mod.rs12
-rw-r--r--src/unix/notbsd/linux/mips/mod.rs12
-rw-r--r--src/unix/notbsd/linux/musl/b32/arm.rs11
-rw-r--r--src/unix/notbsd/linux/musl/b32/mips.rs11
-rw-r--r--src/unix/notbsd/linux/musl/b32/x86.rs11
-rw-r--r--src/unix/notbsd/linux/musl/b64/mod.rs11
-rw-r--r--src/unix/notbsd/linux/other/b32/arm.rs12
-rw-r--r--src/unix/notbsd/linux/other/b32/powerpc.rs1
-rw-r--r--src/unix/notbsd/linux/other/b32/x86.rs12
-rw-r--r--src/unix/notbsd/linux/other/b64/aarch64.rs12
-rw-r--r--src/unix/notbsd/linux/other/b64/powerpc64.rs1
-rw-r--r--src/unix/notbsd/linux/other/b64/sparc64.rs11
-rw-r--r--src/unix/notbsd/linux/other/b64/x86_64.rs12
-rw-r--r--src/unix/notbsd/linux/s390x.rs12
15 files changed, 159 insertions, 2 deletions
diff --git a/libc-test/build.rs b/libc-test/build.rs
index b7f7890705..f88048e8f3 100644
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -377,6 +377,10 @@ fn main() {
// FIXME: unskip it for next major release
"stat" | "stat64" if android => true,
+ // These are tested as part of the linux_fcntl tests since there are
+ // header conflicts when including them with all the other structs.
+ "termios2" => true,
+
_ => false
}
});
@@ -489,6 +493,7 @@ fn main() {
"F_CANCELLK" | "F_ADD_SEALS" | "F_GET_SEALS" => true,
"F_SEAL_SEAL" | "F_SEAL_SHRINK" | "F_SEAL_GROW" | "F_SEAL_WRITE" => true,
"QFMT_VFS_OLD" | "QFMT_VFS_V0" | "QFMT_VFS_V1" if mips && linux => true, // Only on MIPS
+ "BOTHER" => true,
_ => false,
}
@@ -670,8 +675,7 @@ fn main() {
// fails on a lot of platforms.
let mut cfg = ctest::TestGenerator::new();
cfg.skip_type(|_| true)
- .skip_struct(|_| true)
- .skip_fn(|_| true);
+ .skip_fn(|_| true);
if android || linux {
// musl defines these directly in `fcntl.h`
if musl {
@@ -684,16 +688,28 @@ fn main() {
cfg.header("linux/if.h");
}
cfg.header("linux/quota.h");
+ cfg.header("asm/termbits.h");
cfg.skip_const(move |name| {
match name {
"F_CANCELLK" | "F_ADD_SEALS" | "F_GET_SEALS" => false,
"F_SEAL_SEAL" | "F_SEAL_SHRINK" | "F_SEAL_GROW" | "F_SEAL_WRITE" => false,
"QFMT_VFS_OLD" | "QFMT_VFS_V0" | "QFMT_VFS_V1" if mips && linux => false,
+ "BOTHER" => false,
_ => true,
}
});
+ cfg.skip_struct(|s| {
+ s != "termios2"
+ });
+ cfg.type_name(move |ty, is_struct| {
+ match ty {
+ t if is_struct => format!("struct {}", t),
+ t => t.to_string(),
+ }
+ });
} else {
cfg.skip_const(|_| true);
+ cfg.skip_struct(|_| true);
}
cfg.generate("../src/lib.rs", "linux_fcntl.rs");
}
diff --git a/src/unix/notbsd/android/mod.rs b/src/unix/notbsd/android/mod.rs
index 065a5bd8d7..3df10477e8 100644
--- a/src/unix/notbsd/android/mod.rs
+++ b/src/unix/notbsd/android/mod.rs
@@ -84,6 +84,17 @@ s! {
pub c_cc: [::cc_t; ::NCCS],
}
+ pub struct termios2 {
+ pub c_iflag: ::tcflag_t,
+ pub c_oflag: ::tcflag_t,
+ pub c_cflag: ::tcflag_t,
+ pub c_lflag: ::tcflag_t,
+ pub c_line: ::cc_t,
+ pub c_cc: [::cc_t; 19],
+ pub c_ispeed: ::speed_t,
+ pub c_ospeed: ::speed_t,
+ }
+
pub struct flock {
pub l_type: ::c_short,
pub l_whence: ::c_short,
@@ -763,6 +774,7 @@ pub const B19200: ::speed_t = 0o000016;
pub const B38400: ::speed_t = 0o000017;
pub const EXTA: ::speed_t = B19200;
pub const EXTB: ::speed_t = B38400;
+pub const BOTHER: ::speed_t = 0o010000;
pub const B57600: ::speed_t = 0o010001;
pub const B115200: ::speed_t = 0o010002;
pub const B230400: ::speed_t = 0o010003;
diff --git a/src/unix/notbsd/linux/mips/mod.rs b/src/unix/notbsd/linux/mips/mod.rs
index 7681999cc1..6e91f442db 100644
--- a/src/unix/notbsd/linux/mips/mod.rs
+++ b/src/unix/notbsd/linux/mips/mod.rs
@@ -25,6 +25,17 @@ s! {
__size: [::c_char; 32],
__align: [::c_long; 0],
}
+
+ pub struct termios2 {
+ pub c_iflag: ::tcflag_t,
+ pub c_oflag: ::tcflag_t,
+ pub c_cflag: ::tcflag_t,
+ pub c_lflag: ::tcflag_t,
+ pub c_line: ::cc_t,
+ pub c_cc: [::cc_t; 23],
+ pub c_ispeed: ::speed_t,
+ pub c_ospeed: ::speed_t,
+ }
}
pub const SFD_CLOEXEC: ::c_int = 0x080000;
@@ -614,6 +625,7 @@ pub const B19200: ::speed_t = 0o000016;
pub const B38400: ::speed_t = 0o000017;
pub const EXTA: ::speed_t = B19200;
pub const EXTB: ::speed_t = B38400;
+pub const BOTHER: ::speed_t = 0o010000;
pub const B57600: ::speed_t = 0o010001;
pub const B115200: ::speed_t = 0o010002;
pub const B230400: ::speed_t = 0o010003;
diff --git a/src/unix/notbsd/linux/musl/b32/arm.rs b/src/unix/notbsd/linux/musl/b32/arm.rs
index ac09a2feb1..cc9e9bb972 100644
--- a/src/unix/notbsd/linux/musl/b32/arm.rs
+++ b/src/unix/notbsd/linux/musl/b32/arm.rs
@@ -138,6 +138,17 @@ s! {
pub f_namemax: ::c_ulong,
__f_spare: [::c_int; 6],
}
+
+ pub struct termios2 {
+ pub c_iflag: ::tcflag_t,
+ pub c_oflag: ::tcflag_t,
+ pub c_cflag: ::tcflag_t,
+ pub c_lflag: ::tcflag_t,
+ pub c_line: ::cc_t,
+ pub c_cc: [::cc_t; 19],
+ pub c_ispeed: ::speed_t,
+ pub c_ospeed: ::speed_t,
+ }
}
pub const O_DIRECT: ::c_int = 0x10000;
diff --git a/src/unix/notbsd/linux/musl/b32/mips.rs b/src/unix/notbsd/linux/musl/b32/mips.rs
index d320bed50a..021c7dad27 100644
--- a/src/unix/notbsd/linux/musl/b32/mips.rs
+++ b/src/unix/notbsd/linux/musl/b32/mips.rs
@@ -149,6 +149,17 @@ s! {
pub f_namemax: ::c_ulong,
__f_spare: [::c_int; 6],
}
+
+ pub struct termios2 {
+ pub c_iflag: ::tcflag_t,
+ pub c_oflag: ::tcflag_t,
+ pub c_cflag: ::tcflag_t,
+ pub c_lflag: ::tcflag_t,
+ pub c_line: ::cc_t,
+ pub c_cc: [::cc_t; 23],
+ pub c_ispeed: ::speed_t,
+ pub c_ospeed: ::speed_t,
+ }
}
pub const O_DIRECT: ::c_int = 0o100000;
diff --git a/src/unix/notbsd/linux/musl/b32/x86.rs b/src/unix/notbsd/linux/musl/b32/x86.rs
index 549498198c..fa570248c7 100644
--- a/src/unix/notbsd/linux/musl/b32/x86.rs
+++ b/src/unix/notbsd/linux/musl/b32/x86.rs
@@ -151,6 +151,17 @@ s! {
pub f_namemax: ::c_ulong,
__f_spare: [::c_int; 6],
}
+
+ pub struct termios2 {
+ pub c_iflag: ::tcflag_t,
+ pub c_oflag: ::tcflag_t,
+ pub c_cflag: ::tcflag_t,
+ pub c_lflag: ::tcflag_t,
+ pub c_line: ::cc_t,
+ pub c_cc: [::cc_t; 19],
+ pub c_ispeed: ::speed_t,
+ pub c_ospeed: ::speed_t,
+ }
}
pub const O_DIRECT: ::c_int = 0x4000;
diff --git a/src/unix/notbsd/linux/musl/b64/mod.rs b/src/unix/notbsd/linux/musl/b64/mod.rs
index 9a1243a171..70baf8277a 100644
--- a/src/unix/notbsd/linux/musl/b64/mod.rs
+++ b/src/unix/notbsd/linux/musl/b64/mod.rs
@@ -118,6 +118,17 @@ s! {
pub _pad: [::c_int; 29],
_align: [usize; 0],
}
+
+ pub struct termios2 {
+ pub c_iflag: ::tcflag_t,
+ pub c_oflag: ::tcflag_t,
+ pub c_cflag: ::tcflag_t,
+ pub c_lflag: ::tcflag_t,
+ pub c_line: ::cc_t,
+ pub c_cc: [::cc_t; 19],
+ pub c_ispeed: ::speed_t,
+ pub c_ospeed: ::speed_t,
+ }
}
pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
diff --git a/src/unix/notbsd/linux/other/b32/arm.rs b/src/unix/notbsd/linux/other/b32/arm.rs
index d72af86a02..e0f55b283b 100644
--- a/src/unix/notbsd/linux/other/b32/arm.rs
+++ b/src/unix/notbsd/linux/other/b32/arm.rs
@@ -101,6 +101,17 @@ s! {
__glibc_reserved4: ::c_ulong,
__glibc_reserved5: ::c_ulong,
}
+
+ pub struct termios2 {
+ pub c_iflag: ::tcflag_t,
+ pub c_oflag: ::tcflag_t,
+ pub c_cflag: ::tcflag_t,
+ pub c_lflag: ::tcflag_t,
+ pub c_line: ::cc_t,
+ pub c_cc: [::cc_t; 19],
+ pub c_ispeed: ::speed_t,
+ pub c_ospeed: ::speed_t,
+ }
}
pub const O_DIRECT: ::c_int = 0x10000;
@@ -203,6 +214,7 @@ pub const B19200: ::speed_t = 0o000016;
pub const B38400: ::speed_t = 0o000017;
pub const EXTA: ::speed_t = B19200;
pub const EXTB: ::speed_t = B38400;
+pub const BOTHER: ::speed_t = 0o010000;
pub const B57600: ::speed_t = 0o010001;
pub const B115200: ::speed_t = 0o010002;
pub const B230400: ::speed_t = 0o010003;
diff --git a/src/unix/notbsd/linux/other/b32/powerpc.rs b/src/unix/notbsd/linux/other/b32/powerpc.rs
index 588cef48d9..a818413214 100644
--- a/src/unix/notbsd/linux/other/b32/powerpc.rs
+++ b/src/unix/notbsd/linux/other/b32/powerpc.rs
@@ -215,6 +215,7 @@ pub const B2500000: ::speed_t = 0o0033;
pub const B3000000: ::speed_t = 0o0034;
pub const B3500000: ::speed_t = 0o0035;
pub const B4000000: ::speed_t = 0o0036;
+pub const BOTHER: ::speed_t = 0o0037;
pub const VEOL: usize = 6;
pub const VEOL2: usize = 8;
diff --git a/src/unix/notbsd/linux/other/b32/x86.rs b/src/unix/notbsd/linux/other/b32/x86.rs
index 141339694d..1506aca1c0 100644
--- a/src/unix/notbsd/linux/other/b32/x86.rs
+++ b/src/unix/notbsd/linux/other/b32/x86.rs
@@ -200,6 +200,17 @@ s! {
__glibc_reserved4: ::c_ulong,
__glibc_reserved5: ::c_ulong,
}
+
+ pub struct termios2 {
+ pub c_iflag: ::tcflag_t,
+ pub c_oflag: ::tcflag_t,
+ pub c_cflag: ::tcflag_t,
+ pub c_lflag: ::tcflag_t,
+ pub c_line: ::cc_t,
+ pub c_cc: [::cc_t; 19],
+ pub c_ispeed: ::speed_t,
+ pub c_ospeed: ::speed_t,
+ }
}
pub const O_DIRECT: ::c_int = 0x4000;
@@ -304,6 +315,7 @@ pub const B19200: ::speed_t = 0o000016;
pub const B38400: ::speed_t = 0o000017;
pub const EXTA: ::speed_t = B19200;
pub const EXTB: ::speed_t = B38400;
+pub const BOTHER: ::speed_t = 0o010000;
pub const B57600: ::speed_t = 0o010001;
pub const B115200: ::speed_t = 0o010002;
pub const B230400: ::speed_t = 0o010003;
diff --git a/src/unix/notbsd/linux/other/b64/aarch64.rs b/src/unix/notbsd/linux/other/b64/aarch64.rs
index 85b6c2d6fc..542855cbc0 100644
--- a/src/unix/notbsd/linux/other/b64/aarch64.rs
+++ b/src/unix/notbsd/linux/other/b64/aarch64.rs
@@ -111,6 +111,17 @@ s! {
__unused4: ::c_ulong,
__unused5: ::c_ulong
}
+
+ pub struct termios2 {
+ pub c_iflag: ::tcflag_t,
+ pub c_oflag: ::tcflag_t,
+ pub c_cflag: ::tcflag_t,
+ pub c_lflag: ::tcflag_t,
+ pub c_line: ::cc_t,
+ pub c_cc: [::cc_t; 19],
+ pub c_ispeed: ::speed_t,
+ pub c_ospeed: ::speed_t,
+ }
}
pub const TIOCGSOFTCAR: ::c_ulong = 0x5419;
@@ -442,6 +453,7 @@ pub const B19200: ::speed_t = 0o000016;
pub const B38400: ::speed_t = 0o000017;
pub const EXTA: ::speed_t = B19200;
pub const EXTB: ::speed_t = B38400;
+pub const BOTHER: ::speed_t = 0o010000;
pub const B57600: ::speed_t = 0o010001;
pub const B115200: ::speed_t = 0o010002;
pub const B230400: ::speed_t = 0o010003;
diff --git a/src/unix/notbsd/linux/other/b64/powerpc64.rs b/src/unix/notbsd/linux/other/b64/powerpc64.rs
index cd3701c150..e7b2572b5d 100644
--- a/src/unix/notbsd/linux/other/b64/powerpc64.rs
+++ b/src/unix/notbsd/linux/other/b64/powerpc64.rs
@@ -454,6 +454,7 @@ pub const B2500000: ::speed_t = 0o0033;
pub const B3000000: ::speed_t = 0o0034;
pub const B3500000: ::speed_t = 0o0035;
pub const B4000000: ::speed_t = 0o0036;
+pub const BOTHER: ::speed_t = 0o0037;
pub const VEOL: usize = 6;
pub const VEOL2: usize = 8;
diff --git a/src/unix/notbsd/linux/other/b64/sparc64.rs b/src/unix/notbsd/linux/other/b64/sparc64.rs
index d9985301ed..d86f2cc62b 100644
--- a/src/unix/notbsd/linux/other/b64/sparc64.rs
+++ b/src/unix/notbsd/linux/other/b64/sparc64.rs
@@ -111,6 +111,17 @@ s! {
__reserved1: ::c_ulong,
__reserved2: ::c_ulong
}
+
+ pub struct termios2 {
+ pub c_iflag: ::tcflag_t,
+ pub c_oflag: ::tcflag_t,
+ pub c_cflag: ::tcflag_t,
+ pub c_lflag: ::tcflag_t,
+ pub c_line: ::cc_t,
+ pub c_cc: [::cc_t; 19],
+ pub c_ispeed: ::speed_t,
+ pub c_ospeed: ::speed_t,
+ }
}
pub const TIOCGSOFTCAR: ::c_ulong = 0x40047464;
diff --git a/src/unix/notbsd/linux/other/b64/x86_64.rs b/src/unix/notbsd/linux/other/b64/x86_64.rs
index 81b2384a5e..be886f5058 100644
--- a/src/unix/notbsd/linux/other/b64/x86_64.rs
+++ b/src/unix/notbsd/linux/other/b64/x86_64.rs
@@ -212,6 +212,17 @@ s! {
__unused4: ::c_ulong,
__unused5: ::c_ulong
}
+
+ pub struct termios2 {
+ pub c_iflag: ::tcflag_t,
+ pub c_oflag: ::tcflag_t,
+ pub c_cflag: ::tcflag_t,
+ pub c_lflag: ::tcflag_t,
+ pub c_line: ::cc_t,
+ pub c_cc: [::cc_t; 19],
+ pub c_ispeed: ::speed_t,
+ pub c_ospeed: ::speed_t,
+ }
}
pub const TIOCGSOFTCAR: ::c_ulong = 0x5419;
@@ -552,6 +563,7 @@ pub const B19200: ::speed_t = 0o000016;
pub const B38400: ::speed_t = 0o000017;
pub const EXTA: ::speed_t = B19200;
pub const EXTB: ::speed_t = B38400;
+pub const BOTHER: ::speed_t = 0o010000;
pub const B57600: ::speed_t = 0o010001;
pub const B115200: ::speed_t = 0o010002;
pub const B230400: ::speed_t = 0o010003;
diff --git a/src/unix/notbsd/linux/s390x.rs b/src/unix/notbsd/linux/s390x.rs
index e8595e9ef4..e80421f601 100644
--- a/src/unix/notbsd/linux/s390x.rs
+++ b/src/unix/notbsd/linux/s390x.rs
@@ -177,6 +177,17 @@ s! {
pub c_ospeed: ::speed_t,
}
+ pub struct termios2 {
+ pub c_iflag: ::tcflag_t,
+ pub c_oflag: ::tcflag_t,
+ pub c_cflag: ::tcflag_t,
+ pub c_lflag: ::tcflag_t,
+ pub c_line: ::cc_t,
+ pub c_cc: [::cc_t; 19],
+ pub c_ispeed: ::speed_t,
+ pub c_ospeed: ::speed_t,
+ }
+
pub struct sysinfo {
pub uptime: ::c_long,
pub loads: [::c_ulong; 3],
@@ -869,6 +880,7 @@ pub const PARODD: ::tcflag_t = 0o001000;
pub const HUPCL: ::tcflag_t = 0o002000;
pub const CLOCAL: ::tcflag_t = 0o004000;
pub const CBAUDEX: ::tcflag_t = 0o010000;
+pub const BOTHER: ::speed_t = 0o010000;
pub const B57600: ::speed_t = 0o010001;
pub const B115200: ::speed_t = 0o010002;
pub const B230400: ::speed_t = 0o010003;