Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add TIOCSBRK and TIOCCBRK #1587

Merged
merged 2 commits into from May 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/unix/bsd/apple/mod.rs
Expand Up @@ -1760,8 +1760,6 @@ pub const TIOCGETD: ::c_ulong = 0x4004741a;
pub const TIOCSETD: ::c_ulong = 0x8004741b;
pub const TIOCIXON: ::c_uint = 0x20007481;
pub const TIOCIXOFF: ::c_uint = 0x20007480;
pub const TIOCSBRK: ::c_uint = 0x2000747b;
pub const TIOCCBRK: ::c_uint = 0x2000747a;
pub const TIOCSDTR: ::c_uint = 0x20007479;
pub const TIOCCDTR: ::c_uint = 0x20007478;
pub const TIOCGPGRP: ::c_ulong = 0x40047477;
Expand Down
2 changes: 0 additions & 2 deletions src/unix/bsd/freebsdlike/mod.rs
Expand Up @@ -1045,8 +1045,6 @@ pub const TIOCSPGRP: ::c_ulong = 0x80047476;
pub const TIOCGPGRP: ::c_uint = 0x40047477;
pub const TIOCCDTR: ::c_uint = 0x20007478;
pub const TIOCSDTR: ::c_uint = 0x20007479;
pub const TIOCCBRK: ::c_uint = 0x2000747a;
pub const TIOCSBRK: ::c_uint = 0x2000747b;
pub const TTYDISC: ::c_int = 0x0;
pub const SLIPDISC: ::c_int = 0x4;
pub const PPPDISC: ::c_int = 0x5;
Expand Down
3 changes: 3 additions & 0 deletions src/unix/bsd/mod.rs
Expand Up @@ -498,6 +498,9 @@ pub const REG_TRACE: ::c_int = 0o00400;
pub const REG_LARGE: ::c_int = 0o01000;
pub const REG_BACKR: ::c_int = 0o02000;

pub const TIOCCBRK: ::c_uint = 0x2000747a;
pub const TIOCSBRK: ::c_uint = 0x2000747b;

f! {
pub fn CMSG_FIRSTHDR(mhdr: *const ::msghdr) -> *mut ::cmsghdr {
if (*mhdr).msg_controllen as usize >= ::mem::size_of::<::cmsghdr>() {
Expand Down
3 changes: 3 additions & 0 deletions src/unix/linux_like/linux/gnu/b32/mod.rs
Expand Up @@ -241,6 +241,9 @@ pub const PTRACE_SETFPREGS: ::c_uint = 15;
pub const PTRACE_GETREGS: ::c_uint = 12;
pub const PTRACE_SETREGS: ::c_uint = 13;

pub const TIOCSBRK: ::c_int = 0x5427;
pub const TIOCCBRK: ::c_int = 0x5428;

#[link(name = "util")]
extern "C" {
pub fn sysctl(
Expand Down
11 changes: 6 additions & 5 deletions src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs
Expand Up @@ -212,11 +212,6 @@ pub const RTLD_DEEPBIND: ::c_int = 0x8;
pub const RTLD_GLOBAL: ::c_int = 0x100;
pub const RTLD_NOLOAD: ::c_int = 0x4;

pub const TIOCGSOFTCAR: ::c_ulong = 0x5419;
pub const TIOCSSOFTCAR: ::c_ulong = 0x541A;
pub const TIOCGRS485: ::c_int = 0x542E;
pub const TIOCSRS485: ::c_int = 0x542F;

pub const RLIMIT_RSS: ::__rlimit_resource_t = 5;
pub const RLIMIT_AS: ::__rlimit_resource_t = 9;
pub const RLIMIT_MEMLOCK: ::__rlimit_resource_t = 8;
Expand Down Expand Up @@ -447,7 +442,13 @@ pub const TIOCMGET: ::c_ulong = 0x5415;
pub const TIOCMBIS: ::c_ulong = 0x5416;
pub const TIOCMBIC: ::c_ulong = 0x5417;
pub const TIOCMSET: ::c_ulong = 0x5418;
pub const TIOCGSOFTCAR: ::c_ulong = 0x5419;
pub const TIOCSSOFTCAR: ::c_ulong = 0x541A;
pub const TIOCCONS: ::c_ulong = 0x541D;
pub const TIOCSBRK: ::c_ulong = 0x5427;
pub const TIOCCBRK: ::c_ulong = 0x5428;
pub const TIOCGRS485: ::c_int = 0x542E;
pub const TIOCSRS485: ::c_int = 0x542F;

pub const TIOCM_ST: ::c_int = 0x008;
pub const TIOCM_SR: ::c_int = 0x010;
Expand Down
2 changes: 2 additions & 0 deletions src/unix/linux_like/linux/gnu/b64/mips64/mod.rs
Expand Up @@ -874,6 +874,8 @@ pub const TCSETAF: ::c_ulong = 0x5404;
pub const TCSBRK: ::c_ulong = 0x5405;
pub const TCXONC: ::c_ulong = 0x5406;
pub const TCFLSH: ::c_ulong = 0x5407;
pub const TIOCSBRK: ::c_ulong = 0x5427;
pub const TIOCCBRK: ::c_ulong = 0x5428;
pub const TIOCGSOFTCAR: ::c_ulong = 0x5481;
pub const TIOCSSOFTCAR: ::c_ulong = 0x5482;
pub const TIOCINQ: ::c_ulong = 0x467f;
Expand Down
2 changes: 2 additions & 0 deletions src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs
Expand Up @@ -441,6 +441,8 @@ pub const TIOCMBIS: ::c_ulong = 0x5416;
pub const TIOCMBIC: ::c_ulong = 0x5417;
pub const TIOCMSET: ::c_ulong = 0x5418;
pub const TIOCCONS: ::c_ulong = 0x541D;
pub const TIOCSBRK: ::c_ulong = 0x5427;
pub const TIOCCBRK: ::c_ulong = 0x5428;
pub const TIOCGRS485: ::c_int = 0x542E;
pub const TIOCSRS485: ::c_int = 0x542F;

Expand Down
2 changes: 2 additions & 0 deletions src/unix/linux_like/linux/gnu/b64/s390x.rs
Expand Up @@ -575,6 +575,8 @@ pub const TIOCMBIC: ::c_ulong = 0x5417;
pub const TIOCMSET: ::c_ulong = 0x5418;
pub const FIONREAD: ::c_ulong = 0x541B;
pub const TIOCCONS: ::c_ulong = 0x541D;
pub const TIOCSBRK: ::c_ulong = 0x5427;
pub const TIOCCBRK: ::c_ulong = 0x5428;

pub const TCSANOW: ::c_int = 0;
pub const TCSADRAIN: ::c_int = 1;
Expand Down
10 changes: 6 additions & 4 deletions src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs
Expand Up @@ -416,13 +416,15 @@ pub const TIOCLINUX: ::c_ulong = 0x541C;
pub const TIOCGSERIAL: ::c_ulong = 0x541E;
pub const TIOCEXCL: ::c_ulong = 0x2000740d;
pub const TIOCNXCL: ::c_ulong = 0x2000740e;
pub const TIOCSCTTY: ::c_ulong = 0x20007484;
pub const TIOCSTI: ::c_ulong = 0x80017472;
pub const TIOCCONS: ::c_ulong = 0x20007424;
pub const TIOCMGET: ::c_ulong = 0x4004746a;
pub const TIOCMBIS: ::c_ulong = 0x8004746c;
pub const TIOCMBIC: ::c_ulong = 0x8004746b;
pub const TIOCMBIS: ::c_ulong = 0x8004746c;
pub const TIOCMSET: ::c_ulong = 0x8004746d;
pub const TIOCCONS: ::c_ulong = 0x20007424;
pub const TIOCSTI: ::c_ulong = 0x80017472;
pub const TIOCCBRK: ::c_ulong = 0x2000747a;
pub const TIOCSBRK: ::c_ulong = 0x2000747b;
pub const TIOCSCTTY: ::c_ulong = 0x20007484;

pub const TIOCM_ST: ::c_int = 0x008;
pub const TIOCM_SR: ::c_int = 0x010;
Expand Down
2 changes: 2 additions & 0 deletions src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs
Expand Up @@ -839,6 +839,8 @@ pub const TIOCOUTQ: ::c_ulong = 0x5411;
pub const TIOCGWINSZ: ::c_ulong = 0x5413;
pub const TIOCSWINSZ: ::c_ulong = 0x5414;
pub const FIONREAD: ::c_ulong = 0x541B;
pub const TIOCSBRK: ::c_ulong = 0x5427;
pub const TIOCCBRK: ::c_ulong = 0x5428;

// offsets in user_regs_structs, from sys/reg.h
pub const R15: ::c_int = 0;
Expand Down
2 changes: 0 additions & 2 deletions src/unix/linux_like/linux/musl/b32/hexagon.rs
Expand Up @@ -725,7 +725,6 @@ pub const TCSETX: ::c_int = 21555;
pub const TCSETXF: ::c_int = 21556;
pub const TCSETXW: ::c_int = 21557;
pub const TCXONC: ::c_int = 21514;
pub const TIOCCBRK: ::c_int = 21544;
pub const TIOCCONS: ::c_int = 21533;
pub const TIOCEXCL: ::c_int = 21516;
pub const TIOCGETD: ::c_int = 21540;
Expand Down Expand Up @@ -769,7 +768,6 @@ pub const TIOCPKT_IOCTL: ::c_int = 64;
pub const TIOCPKT_NOSTOP: ::c_int = 16;
pub const TIOCPKT_START: ::c_int = 8;
pub const TIOCPKT_STOP: ::c_int = 4;
pub const TIOCSBRK: ::c_int = 21543;
pub const TIOCSCTTY: ::c_int = 21518;
pub const TIOCSERCONFIG: ::c_int = 21587;
pub const TIOCSERGETLSR: ::c_int = 21593;
Expand Down
3 changes: 3 additions & 0 deletions src/unix/linux_like/linux/musl/mod.rs
Expand Up @@ -422,6 +422,9 @@ pub const RLIMIT_RTPRIO: ::c_int = 14;

pub const REG_OK: ::c_int = 0;

pub const TIOCSBRK: ::c_int = 0x5427;
pub const TIOCCBRK: ::c_int = 0x5428;

extern "C" {
pub fn sendmmsg(
sockfd: ::c_int,
Expand Down