Skip to content

Commit

Permalink
Add TCGETS2 and TCSETS2 (and variants) ioctl constants for Linux.
Browse files Browse the repository at this point in the history
  • Loading branch information
de-vri-es committed Nov 3, 2021
1 parent 09fdbcc commit 75b7725
Show file tree
Hide file tree
Showing 12 changed files with 59 additions and 2 deletions.
17 changes: 15 additions & 2 deletions libc-test/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1659,6 +1659,10 @@ fn test_android(target: &str) {
// Requires Linux kernel 5.6
"VMADDR_CID_LOCAL" => true,

// FIXME: conflicts with standard C headers and is tested in
// `linux_termios.rs` below:
"TCGETS2" | "TCSETS2" | "TCSETSW2" | "TCSETSF2" => true,

_ => false,
}
});
Expand Down Expand Up @@ -2867,7 +2871,11 @@ fn test_linux(target: &str) {

// FIXME: conflicts with glibc headers and is tested in
// `linux_termios.rs` below:
"BOTHER" => true,
| "BOTHER"
| "TCGETS2"
| "TCSETS2"
| "TCSETSW2"
| "TCSETSF2" => true,

// FIXME: on musl the pthread types are defined a little differently
// - these constants are used by the glibc implementation.
Expand Down Expand Up @@ -3210,10 +3218,15 @@ fn test_linux_like_apis(target: &str) {
// test termios
let mut cfg = ctest_cfg();
cfg.header("asm/termbits.h");
cfg.header("linux/termios.h");
cfg.skip_type(|_| true)
.skip_static(|_| true)
.skip_fn(|_| true)
.skip_const(|c| c != "BOTHER")
.skip_const(|c| match c {
"BOTHER" => false,
"TCGETS2" | "TCSETS2" | "TCSETSW2" | "TCSETSF2" => false,
_ => true,
})
.skip_struct(|s| s != "termios2")
.type_name(move |ty, is_struct, is_union| match ty {
t if is_struct => format!("struct {}", t),
Expand Down
4 changes: 4 additions & 0 deletions src/unix/linux_like/android/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1338,6 +1338,10 @@ pub const TCGETS: ::c_int = 0x5401;
pub const TCSETS: ::c_int = 0x5402;
pub const TCSETSW: ::c_int = 0x5403;
pub const TCSETSF: ::c_int = 0x5404;
pub const TCGETS2: ::c_ulong = 0x802c542a;
pub const TCSETS2: ::c_ulong = 0x402c542b;
pub const TCSETSW2: ::c_ulong = 0x402c542c;
pub const TCSETSF2: ::c_ulong = 0x402c542d;
pub const TCGETA: ::c_int = 0x5405;
pub const TCSETA: ::c_int = 0x5406;
pub const TCSETAW: ::c_int = 0x5407;
Expand Down
4 changes: 4 additions & 0 deletions src/unix/linux_like/linux/gnu/b32/arm/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,10 @@ pub const TCGETS: ::c_ulong = 0x5401;
pub const TCSETS: ::c_ulong = 0x5402;
pub const TCSETSW: ::c_ulong = 0x5403;
pub const TCSETSF: ::c_ulong = 0x5404;
pub const TCGETS2: ::c_ulong = 0x802c542a;
pub const TCSETS2: ::c_ulong = 0x402c542b;
pub const TCSETSW2: ::c_ulong = 0x402c542c;
pub const TCSETSF2: ::c_ulong = 0x402c542d;
pub const TCGETA: ::c_ulong = 0x5405;
pub const TCSETA: ::c_ulong = 0x5406;
pub const TCSETAW: ::c_ulong = 0x5407;
Expand Down
4 changes: 4 additions & 0 deletions src/unix/linux_like/linux/gnu/b32/mips/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -730,6 +730,10 @@ pub const TCGETS: ::c_ulong = 0x540d;
pub const TCSETS: ::c_ulong = 0x540e;
pub const TCSETSW: ::c_ulong = 0x540f;
pub const TCSETSF: ::c_ulong = 0x5410;
pub const TCGETS2: ::c_ulong = 0x802c542a;
pub const TCSETS2: ::c_ulong = 0x402c542b;
pub const TCSETSW2: ::c_ulong = 0x402c542c;
pub const TCSETSF2: ::c_ulong = 0x402c542d;
pub const TCGETA: ::c_ulong = 0x5401;
pub const TCSETA: ::c_ulong = 0x5402;
pub const TCSETAW: ::c_ulong = 0x5403;
Expand Down
4 changes: 4 additions & 0 deletions src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,10 @@ pub const TCGETS: ::c_ulong = 21505;
pub const TCSETS: ::c_ulong = 21506;
pub const TCSETSW: ::c_ulong = 21507;
pub const TCSETSF: ::c_ulong = 21508;
pub const TCGETS2: ::c_ulong = 0x802c542a;
pub const TCSETS2: ::c_ulong = 0x402c542b;
pub const TCSETSW2: ::c_ulong = 0x402c542c;
pub const TCSETSF2: ::c_ulong = 0x402c542d;
pub const TCGETA: ::c_ulong = 21509;
pub const TCSETA: ::c_ulong = 21510;
pub const TCSETAW: ::c_ulong = 21511;
Expand Down
4 changes: 4 additions & 0 deletions src/unix/linux_like/linux/gnu/b32/sparc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,10 @@ pub const TCGETS: ::c_ulong = 0x40245408;
pub const TCSETS: ::c_ulong = 0x80245409;
pub const TCSETSW: ::c_ulong = 0x8024540a;
pub const TCSETSF: ::c_ulong = 0x8024540b;
pub const TCGETS2: ::c_ulong = 0x402c542a;
pub const TCSETS2: ::c_ulong = 0x802c542b;
pub const TCSETSW2: ::c_ulong = 0x802c542c;
pub const TCSETSF2: ::c_ulong = 0x802c542d;
pub const TCGETA: ::c_ulong = 0x40125401;
pub const TCSETA: ::c_ulong = 0x80125402;
pub const TCSETAW: ::c_ulong = 0x80125403;
Expand Down
4 changes: 4 additions & 0 deletions src/unix/linux_like/linux/gnu/b32/x86/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,10 @@ pub const TCGETS: ::c_ulong = 0x5401;
pub const TCSETS: ::c_ulong = 0x5402;
pub const TCSETSW: ::c_ulong = 0x5403;
pub const TCSETSF: ::c_ulong = 0x5404;
pub const TCGETS2: ::c_ulong = 0x802c542a;
pub const TCSETS2: ::c_ulong = 0x402c542b;
pub const TCSETSW2: ::c_ulong = 0x402c542c;
pub const TCSETSF2: ::c_ulong = 0x402c542d;
pub const TCGETA: ::c_ulong = 0x5405;
pub const TCSETA: ::c_ulong = 0x5406;
pub const TCSETAW: ::c_ulong = 0x5407;
Expand Down
4 changes: 4 additions & 0 deletions src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,10 @@ pub const TCGETS: ::c_ulong = 0x5401;
pub const TCSETS: ::c_ulong = 0x5402;
pub const TCSETSW: ::c_ulong = 0x5403;
pub const TCSETSF: ::c_ulong = 0x5404;
pub const TCGETS2: ::c_ulong = 0x802c542a;
pub const TCSETS2: ::c_ulong = 0x402c542b;
pub const TCSETSW2: ::c_ulong = 0x402c542c;
pub const TCSETSF2: ::c_ulong = 0x402c542d;
pub const TCGETA: ::c_ulong = 0x5405;
pub const TCSETA: ::c_ulong = 0x5406;
pub const TCSETAW: ::c_ulong = 0x5407;
Expand Down
4 changes: 4 additions & 0 deletions src/unix/linux_like/linux/gnu/b64/mips64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -830,6 +830,10 @@ pub const TCGETS: ::c_ulong = 0x540d;
pub const TCSETS: ::c_ulong = 0x540e;
pub const TCSETSW: ::c_ulong = 0x540f;
pub const TCSETSF: ::c_ulong = 0x5410;
pub const TCGETS2: ::c_ulong = 0x802c542a;
pub const TCSETS2: ::c_ulong = 0x402c542b;
pub const TCSETSW2: ::c_ulong = 0x402c542c;
pub const TCSETSF2: ::c_ulong = 0x402c542d;
pub const TCGETA: ::c_ulong = 0x5401;
pub const TCSETA: ::c_ulong = 0x5402;
pub const TCSETAW: ::c_ulong = 0x5403;
Expand Down
4 changes: 4 additions & 0 deletions src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,10 @@ pub const TCGETS: ::c_ulong = 21505;
pub const TCSETS: ::c_ulong = 21506;
pub const TCSETSW: ::c_ulong = 21507;
pub const TCSETSF: ::c_ulong = 21508;
pub const TCGETS2: ::c_ulong = 0x802c542a;
pub const TCSETS2: ::c_ulong = 0x402c542b;
pub const TCSETSW2: ::c_ulong = 0x402c542c;
pub const TCSETSF2: ::c_ulong = 0x402c542d;
pub const TCGETA: ::c_ulong = 21509;
pub const TCSETA: ::c_ulong = 21510;
pub const TCSETAW: ::c_ulong = 21511;
Expand Down
4 changes: 4 additions & 0 deletions src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,10 @@ pub const TCGETS: ::c_ulong = 0x40245408;
pub const TCSETS: ::c_ulong = 0x80245409;
pub const TCSETSW: ::c_ulong = 0x8024540a;
pub const TCSETSF: ::c_ulong = 0x8024540b;
pub const TCGETS2: ::c_ulong = 0x402c542a;
pub const TCSETS2: ::c_ulong = 0x802c542b;
pub const TCSETSW2: ::c_ulong = 0x802c542c;
pub const TCSETSF2: ::c_ulong = 0x802c542d;
pub const TCGETA: ::c_ulong = 0x40125401;
pub const TCSETA: ::c_ulong = 0x80125402;
pub const TCSETAW: ::c_ulong = 0x80125403;
Expand Down
4 changes: 4 additions & 0 deletions src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -772,6 +772,10 @@ pub const TCGETS: ::c_ulong = 0x5401;
pub const TCSETS: ::c_ulong = 0x5402;
pub const TCSETSW: ::c_ulong = 0x5403;
pub const TCSETSF: ::c_ulong = 0x5404;
pub const TCGETS2: ::c_ulong = 0x802c542a;
pub const TCSETS2: ::c_ulong = 0x402c542b;
pub const TCSETSW2: ::c_ulong = 0x402c542c;
pub const TCSETSF2: ::c_ulong = 0x402c542d;
pub const TCGETA: ::c_ulong = 0x5405;
pub const TCSETA: ::c_ulong = 0x5406;
pub const TCSETAW: ::c_ulong = 0x5407;
Expand Down

0 comments on commit 75b7725

Please sign in to comment.