From 14a3a11e246aa4385cc4d59503b1cccf948efd90 Mon Sep 17 00:00:00 2001 From: Bryant Mairs Date: Fri, 23 Jun 2017 08:33:20 -0700 Subject: [PATCH 1/4] Add more termios output flags --- src/unix/bsd/freebsdlike/freebsd/mod.rs | 4 +++ src/unix/bsd/freebsdlike/mod.rs | 3 ++ src/unix/bsd/netbsdlike/mod.rs | 2 ++ src/unix/bsd/netbsdlike/netbsd/mod.rs | 3 ++ src/unix/bsd/netbsdlike/openbsdlike/mod.rs | 4 +++ src/unix/haiku/mod.rs | 29 ++++++++++++++++++++ src/unix/notbsd/android/mod.rs | 8 ++++++ src/unix/notbsd/linux/mips/mod.rs | 10 +++++++ src/unix/notbsd/linux/musl/mod.rs | 11 ++++++++ src/unix/notbsd/linux/other/b32/arm.rs | 10 +++++++ src/unix/notbsd/linux/other/b32/powerpc.rs | 8 ++++++ src/unix/notbsd/linux/other/b32/x86.rs | 10 +++++++ src/unix/notbsd/linux/other/b64/aarch64.rs | 10 +++++++ src/unix/notbsd/linux/other/b64/powerpc64.rs | 8 ++++++ src/unix/notbsd/linux/other/b64/sparc64.rs | 10 +++++++ src/unix/notbsd/linux/other/b64/x86_64.rs | 10 +++++++ src/unix/notbsd/linux/s390x.rs | 20 ++++++++++++++ src/unix/notbsd/mod.rs | 5 ++++ 18 files changed, 165 insertions(+) diff --git a/src/unix/bsd/freebsdlike/freebsd/mod.rs b/src/unix/bsd/freebsdlike/freebsd/mod.rs index fa32eefb40051..824a966f046a3 100644 --- a/src/unix/bsd/freebsdlike/freebsd/mod.rs +++ b/src/unix/bsd/freebsdlike/freebsd/mod.rs @@ -517,6 +517,10 @@ pub const AT_SYMLINK_NOFOLLOW: ::c_int = 0x200; pub const AT_SYMLINK_FOLLOW: ::c_int = 0x400; pub const AT_REMOVEDIR: ::c_int = 0x800; +pub const TABDLY: ::tcflag_t = 0x00000004; +pub const TAB0: ::tcflag_t = 0x00000000; +pub const TAB3: ::tcflag_t = 0x00000004; + extern { pub fn __error() -> *mut ::c_int; diff --git a/src/unix/bsd/freebsdlike/mod.rs b/src/unix/bsd/freebsdlike/mod.rs index e1e75996a4bc4..2929df0401213 100644 --- a/src/unix/bsd/freebsdlike/mod.rs +++ b/src/unix/bsd/freebsdlike/mod.rs @@ -861,6 +861,9 @@ pub const EXTB: speed_t = 38400; pub const SEM_FAILED: *mut sem_t = 0 as *mut sem_t; pub const CRTSCTS: ::tcflag_t = 0x00030000; +pub const OCRNL: ::tcflag_t = 0x10; +pub const ONOCR: ::tcflag_t = 0x20; +pub const ONLRET: ::tcflag_t = 0x40; f! { pub fn WIFCONTINUED(status: ::c_int) -> bool { diff --git a/src/unix/bsd/netbsdlike/mod.rs b/src/unix/bsd/netbsdlike/mod.rs index 32991e84ff307..789e7c4237a67 100644 --- a/src/unix/bsd/netbsdlike/mod.rs +++ b/src/unix/bsd/netbsdlike/mod.rs @@ -538,6 +538,8 @@ pub const EXTB: speed_t = 38400; pub const SEM_FAILED: *mut sem_t = 0 as *mut sem_t; +pub const OCRNL: ::tcflag_t = 0x10; + f! { pub fn WSTOPSIG(status: ::c_int) -> ::c_int { status >> 8 diff --git a/src/unix/bsd/netbsdlike/netbsd/mod.rs b/src/unix/bsd/netbsdlike/netbsd/mod.rs index 47e077ebcce31..5b3a6e62fc209 100644 --- a/src/unix/bsd/netbsdlike/netbsd/mod.rs +++ b/src/unix/bsd/netbsdlike/netbsd/mod.rs @@ -644,6 +644,9 @@ pub const P_PGID: idtype_t = 4; pub const B460800: ::speed_t = 460800; pub const B921600: ::speed_t = 921600; +pub const ONOCR: ::tcflag_t = 0x20; +pub const ONLRET: ::tcflag_t = 0x40; + // dirfd() is a macro on netbsd to access // the first field of the struct where dirp points to: // http://cvsweb.netbsd.org/bsdweb.cgi/src/include/dirent.h?rev=1.36 diff --git a/src/unix/bsd/netbsdlike/openbsdlike/mod.rs b/src/unix/bsd/netbsdlike/openbsdlike/mod.rs index 88fbc418df78e..b9ef3cf9226f9 100644 --- a/src/unix/bsd/netbsdlike/openbsdlike/mod.rs +++ b/src/unix/bsd/netbsdlike/openbsdlike/mod.rs @@ -460,6 +460,10 @@ pub const KI_WMESGLEN: ::c_int = 8; pub const KI_MAXLOGNAME: ::c_int = 32; pub const KI_EMULNAMELEN: ::c_int = 8; +pub const OLCUC: ::tcflag_t = 0x20; +pub const ONOCR: ::tcflag_t = 0x40; +pub const ONLRET: ::tcflag_t = 0x80; + extern { pub fn dirfd(dirp: *mut ::DIR) -> ::c_int; pub fn getnameinfo(sa: *const ::sockaddr, diff --git a/src/unix/haiku/mod.rs b/src/unix/haiku/mod.rs index e90aa306fddc7..6734795c22983 100644 --- a/src/unix/haiku/mod.rs +++ b/src/unix/haiku/mod.rs @@ -686,6 +686,35 @@ pub const P_ALL: idtype_t = 0; pub const P_PID: idtype_t = 1; pub const P_PGID: idtype_t = 2; +pub const OLCUC: ::tcflag_t = 0o000002; +pub const OCRNL: ::tcflag_t = 0o000010; +pub const ONOCR: ::tcflag_t = 0o000020; +pub const ONLRET: ::tcflag_t = 0o000040; +pub const OFILL: ::tcflag_t = 0o000100; +pub const OFDEL: ::tcflag_t = 0o000200; +pub const NLDLY: ::tcflag_t = 0o000400; +pub const NL0: ::tcflag_t = 0o000000; +pub const NL1: ::tcflag_t = 0o000400; +pub const CRDLY: ::tcflag_t = 0o003000; +pub const CR0: ::tcflag_t = 0o000000; +pub const CR1: ::tcflag_t = 0o001000; +pub const CR2: ::tcflag_t = 0o002000; +pub const CR3: ::tcflag_t = 0o003000; +pub const TABDLY: ::tcflag_t = 0o014000; +pub const TAB0: ::tcflag_t = 0o000000; +pub const TAB1: ::tcflag_t = 0o004000; +pub const TAB2: ::tcflag_t = 0o010000; +pub const TAB3: ::tcflag_t = 0o014000; +pub const BSDLY: ::tcflag_t = 0o020000; +pub const BS0: ::tcflag_t = 0o000000; +pub const BS1: ::tcflag_t = 0o020000; +pub const FFDLY: ::tcflag_t = 0o100000; +pub const FF0: ::tcflag_t = 0o000000; +pub const FF1: ::tcflag_t = 0o100000; +pub const VTDLY: ::tcflag_t = 0o040000; +pub const VT0: ::tcflag_t = 0o000000; +pub const VT1: ::tcflag_t = 0o040000; + f! { pub fn FD_CLR(fd: ::c_int, set: *mut fd_set) -> () { let fd = fd as usize; diff --git a/src/unix/notbsd/android/mod.rs b/src/unix/notbsd/android/mod.rs index 2a7d572dc5cc5..2fb131b103d0d 100644 --- a/src/unix/notbsd/android/mod.rs +++ b/src/unix/notbsd/android/mod.rs @@ -626,6 +626,14 @@ pub const ISIG: ::tcflag_t = 0x00000001; pub const ICANON: ::tcflag_t = 0x00000002; pub const PENDIN: ::tcflag_t = 0x00004000; pub const NOFLSH: ::tcflag_t = 0x00000080; +pub const OLCUC: ::tcflag_t = 0o000002; +pub const NLDLY: ::tcflag_t = 0o000400; +pub const CRDLY: ::tcflag_t = 0o003000; +pub const TABDLY: ::tcflag_t = 0o014000; +pub const BSDLY: ::tcflag_t = 0o020000; +pub const FFDLY: ::tcflag_t = 0o100000; +pub const VTDLY: ::tcflag_t = 0o040000; +pub const XTABS: ::tcflag_t = 0o014000; pub const B0: ::speed_t = 0o000000; pub const B50: ::speed_t = 0o000001; diff --git a/src/unix/notbsd/linux/mips/mod.rs b/src/unix/notbsd/linux/mips/mod.rs index b2ad107caedf9..8555cce3cf3b2 100644 --- a/src/unix/notbsd/linux/mips/mod.rs +++ b/src/unix/notbsd/linux/mips/mod.rs @@ -490,6 +490,16 @@ pub const ISIG: ::tcflag_t = 0x00000001; pub const ICANON: ::tcflag_t = 0x00000002; pub const PENDIN: ::tcflag_t = 0x00004000; pub const NOFLSH: ::tcflag_t = 0x00000080; +pub const CIBAUD: ::tcflag_t = 0o02003600000; +pub const CBAUDEX: ::tcflag_t = 0o010000; +pub const OLCUC: ::tcflag_t = 0o000002; +pub const NLDLY: ::tcflag_t = 0o000400; +pub const CRDLY: ::tcflag_t = 0o003000; +pub const TABDLY: ::tcflag_t = 0o014000; +pub const BSDLY: ::tcflag_t = 0o020000; +pub const FFDLY: ::tcflag_t = 0o100000; +pub const VTDLY: ::tcflag_t = 0o040000; +pub const XTABS: ::tcflag_t = 0o014000; pub const B0: ::speed_t = 0o000000; pub const B50: ::speed_t = 0o000001; diff --git a/src/unix/notbsd/linux/musl/mod.rs b/src/unix/notbsd/linux/musl/mod.rs index b365028b76aca..31ea45e800452 100644 --- a/src/unix/notbsd/linux/musl/mod.rs +++ b/src/unix/notbsd/linux/musl/mod.rs @@ -280,6 +280,17 @@ pub const ISIG: ::tcflag_t = 0x00000001; pub const ICANON: ::tcflag_t = 0x00000002; pub const PENDIN: ::tcflag_t = 0x00004000; pub const NOFLSH: ::tcflag_t = 0x00000080; +pub const CMSPAR: ::tcflag_t = 0o10000000000; +pub const CIBAUD: ::tcflag_t = 0o02003600000; +pub const CBAUDEX: ::tcflag_t = 0o010000; +pub const OLCUC: ::tcflag_t = 0o000002; +pub const NLDLY: ::tcflag_t = 0o000400; +pub const CRDLY: ::tcflag_t = 0o003000; +pub const TABDLY: ::tcflag_t = 0o014000; +pub const BSDLY: ::tcflag_t = 0o020000; +pub const FFDLY: ::tcflag_t = 0o100000; +pub const VTDLY: ::tcflag_t = 0o040000; +pub const XTABS: ::tcflag_t = 0o014000; pub const B0: ::speed_t = 0o000000; pub const B50: ::speed_t = 0o000001; diff --git a/src/unix/notbsd/linux/other/b32/arm.rs b/src/unix/notbsd/linux/other/b32/arm.rs index ee6d67403a1b1..ec376927dc879 100644 --- a/src/unix/notbsd/linux/other/b32/arm.rs +++ b/src/unix/notbsd/linux/other/b32/arm.rs @@ -141,6 +141,16 @@ pub const ISIG: ::tcflag_t = 0x00000001; pub const ICANON: ::tcflag_t = 0x00000002; pub const PENDIN: ::tcflag_t = 0x00004000; pub const NOFLSH: ::tcflag_t = 0x00000080; +pub const CIBAUD: ::tcflag_t = 0o02003600000; +pub const CBAUDEX: ::tcflag_t = 0o010000; +pub const OLCUC: ::tcflag_t = 0o000002; +pub const NLDLY: ::tcflag_t = 0o000400; +pub const CRDLY: ::tcflag_t = 0o003000; +pub const TABDLY: ::tcflag_t = 0o014000; +pub const BSDLY: ::tcflag_t = 0o020000; +pub const FFDLY: ::tcflag_t = 0o100000; +pub const VTDLY: ::tcflag_t = 0o040000; +pub const XTABS: ::tcflag_t = 0o014000; pub const B0: ::speed_t = 0o000000; pub const B50: ::speed_t = 0o000001; diff --git a/src/unix/notbsd/linux/other/b32/powerpc.rs b/src/unix/notbsd/linux/other/b32/powerpc.rs index 035bfe19cdc01..cb15857aeb57a 100644 --- a/src/unix/notbsd/linux/other/b32/powerpc.rs +++ b/src/unix/notbsd/linux/other/b32/powerpc.rs @@ -144,6 +144,14 @@ pub const ISIG: ::tcflag_t = 0x80; pub const ICANON: ::tcflag_t = 0x100; pub const PENDIN: ::tcflag_t = 0x20000000; pub const NOFLSH: ::tcflag_t = 0x80000000; +pub const OLCUC: ::tcflag_t = 0o000004; +pub const NLDLY: ::tcflag_t = 0o001400; +pub const CRDLY: ::tcflag_t = 0o030000; +pub const TABDLY: ::tcflag_t = 0o006000; +pub const BSDLY: ::tcflag_t = 0o100000; +pub const FFDLY: ::tcflag_t = 0o040000; +pub const VTDLY: ::tcflag_t = 0o200000; +pub const XTABS: ::tcflag_t = 0o006000; pub const B0: ::speed_t = 0o000000; pub const B50: ::speed_t = 0o000001; diff --git a/src/unix/notbsd/linux/other/b32/x86.rs b/src/unix/notbsd/linux/other/b32/x86.rs index 04a3caad12ac1..d55d4408a0211 100644 --- a/src/unix/notbsd/linux/other/b32/x86.rs +++ b/src/unix/notbsd/linux/other/b32/x86.rs @@ -247,6 +247,16 @@ pub const ISIG: ::tcflag_t = 0x00000001; pub const ICANON: ::tcflag_t = 0x00000002; pub const PENDIN: ::tcflag_t = 0x00004000; pub const NOFLSH: ::tcflag_t = 0x00000080; +pub const CIBAUD: ::tcflag_t = 0o02003600000; +pub const CBAUDEX: ::tcflag_t = 0o010000; +pub const OLCUC: ::tcflag_t = 0o000002; +pub const NLDLY: ::tcflag_t = 0o000400; +pub const CRDLY: ::tcflag_t = 0o003000; +pub const TABDLY: ::tcflag_t = 0o014000; +pub const BSDLY: ::tcflag_t = 0o020000; +pub const FFDLY: ::tcflag_t = 0o100000; +pub const VTDLY: ::tcflag_t = 0o040000; +pub const XTABS: ::tcflag_t = 0o014000; pub const B0: ::speed_t = 0o000000; pub const B50: ::speed_t = 0o000001; diff --git a/src/unix/notbsd/linux/other/b64/aarch64.rs b/src/unix/notbsd/linux/other/b64/aarch64.rs index 77cee3d217518..a8d0f8dae584a 100644 --- a/src/unix/notbsd/linux/other/b64/aarch64.rs +++ b/src/unix/notbsd/linux/other/b64/aarch64.rs @@ -385,6 +385,16 @@ pub const ISIG: ::tcflag_t = 0x00000001; pub const ICANON: ::tcflag_t = 0x00000002; pub const PENDIN: ::tcflag_t = 0x00004000; pub const NOFLSH: ::tcflag_t = 0x00000080; +pub const CIBAUD: ::tcflag_t = 0o02003600000; +pub const CBAUDEX: ::tcflag_t = 0o010000; +pub const OLCUC: ::tcflag_t = 0o000002; +pub const NLDLY: ::tcflag_t = 0o000400; +pub const CRDLY: ::tcflag_t = 0o003000; +pub const TABDLY: ::tcflag_t = 0o014000; +pub const BSDLY: ::tcflag_t = 0o020000; +pub const FFDLY: ::tcflag_t = 0o100000; +pub const VTDLY: ::tcflag_t = 0o040000; +pub const XTABS: ::tcflag_t = 0o014000; pub const B0: ::speed_t = 0o000000; pub const B50: ::speed_t = 0o000001; diff --git a/src/unix/notbsd/linux/other/b64/powerpc64.rs b/src/unix/notbsd/linux/other/b64/powerpc64.rs index 8c19b0713dc5e..8899a004715e3 100644 --- a/src/unix/notbsd/linux/other/b64/powerpc64.rs +++ b/src/unix/notbsd/linux/other/b64/powerpc64.rs @@ -383,6 +383,14 @@ pub const ISIG: ::tcflag_t = 0x80; pub const ICANON: ::tcflag_t = 0x100; pub const PENDIN: ::tcflag_t = 0x20000000; pub const NOFLSH: ::tcflag_t = 0x80000000; +pub const OLCUC: ::tcflag_t = 0o000004; +pub const NLDLY: ::tcflag_t = 0o001400; +pub const CRDLY: ::tcflag_t = 0o030000; +pub const TABDLY: ::tcflag_t = 0o006000; +pub const BSDLY: ::tcflag_t = 0o100000; +pub const FFDLY: ::tcflag_t = 0o040000; +pub const VTDLY: ::tcflag_t = 0o200000; +pub const XTABS: ::tcflag_t = 0o006000; pub const B0: ::speed_t = 0o000000; pub const B50: ::speed_t = 0o000001; diff --git a/src/unix/notbsd/linux/other/b64/sparc64.rs b/src/unix/notbsd/linux/other/b64/sparc64.rs index 12598e0522941..c9c3484c10782 100644 --- a/src/unix/notbsd/linux/other/b64/sparc64.rs +++ b/src/unix/notbsd/linux/other/b64/sparc64.rs @@ -342,6 +342,16 @@ pub const ISIG: ::tcflag_t = 0x1; pub const ICANON: ::tcflag_t = 0x2; pub const PENDIN: ::tcflag_t = 0x4000; pub const NOFLSH: ::tcflag_t = 0x80; +pub const CIBAUD: ::tcflag_t = 0o02003600000; +pub const CBAUDEX: ::tcflag_t = 0x00001000; +pub const OLCUC: ::tcflag_t = 0o000002; +pub const NLDLY: ::tcflag_t = 0o000400; +pub const CRDLY: ::tcflag_t = 0o003000; +pub const TABDLY: ::tcflag_t = 0o014000; +pub const BSDLY: ::tcflag_t = 0o020000; +pub const FFDLY: ::tcflag_t = 0o100000; +pub const VTDLY: ::tcflag_t = 0o040000; +pub const XTABS: ::tcflag_t = 0o014000; pub const VEOL: usize = 5; pub const VEOL2: usize = 6; diff --git a/src/unix/notbsd/linux/other/b64/x86_64.rs b/src/unix/notbsd/linux/other/b64/x86_64.rs index e1b65e8e71be7..74f4b5a7d58c9 100644 --- a/src/unix/notbsd/linux/other/b64/x86_64.rs +++ b/src/unix/notbsd/linux/other/b64/x86_64.rs @@ -505,6 +505,16 @@ pub const ISIG: ::tcflag_t = 0x00000001; pub const ICANON: ::tcflag_t = 0x00000002; pub const PENDIN: ::tcflag_t = 0x00004000; pub const NOFLSH: ::tcflag_t = 0x00000080; +pub const CIBAUD: ::tcflag_t = 0o02003600000; +pub const CBAUDEX: ::tcflag_t = 0o010000; +pub const OLCUC: ::tcflag_t = 0o000002; +pub const NLDLY: ::tcflag_t = 0o000400; +pub const CRDLY: ::tcflag_t = 0o003000; +pub const TABDLY: ::tcflag_t = 0o014000; +pub const BSDLY: ::tcflag_t = 0o020000; +pub const FFDLY: ::tcflag_t = 0o100000; +pub const VTDLY: ::tcflag_t = 0o040000; +pub const XTABS: ::tcflag_t = 0o014000; pub const B0: ::speed_t = 0o000000; pub const B50: ::speed_t = 0o000001; diff --git a/src/unix/notbsd/linux/s390x.rs b/src/unix/notbsd/linux/s390x.rs index 1c0cd56d6f14c..e77ff5c5c0843 100644 --- a/src/unix/notbsd/linux/s390x.rs +++ b/src/unix/notbsd/linux/s390x.rs @@ -692,6 +692,26 @@ pub const LINUX_REBOOT_CMD_KEXEC: ::c_int = 0x45584543; pub const SYS_gettid: ::c_long = 236; pub const SYS_perf_event_open: ::c_long = 331; +pub const CMSPAR: ::tcflag_t = 0o10000000000; +pub const OLCUC: ::tcflag_t = 0o000002; +pub const NLDLY: ::tcflag_t = 0o000400; +pub const NL1: ::tcflag_t = 0x00000100; +pub const CRDLY: ::tcflag_t = 0o003000; +pub const CR1: ::tcflag_t = 0x00000200; +pub const CR2: ::tcflag_t = 0x00000400; +pub const CR3: ::tcflag_t = 0x00000600; +pub const TABDLY: ::tcflag_t = 0o014000; +pub const TAB1: ::tcflag_t = 0x00000800; +pub const TAB2: ::tcflag_t = 0x00001000; +pub const TAB3: ::tcflag_t = 0x00001800; +pub const BSDLY: ::tcflag_t = 0o020000; +pub const BS1: ::tcflag_t = 0x00002000; +pub const FFDLY: ::tcflag_t = 0o100000; +pub const FF1: ::tcflag_t = 0x00008000; +pub const VTDLY: ::tcflag_t = 0o040000; +pub const VT1: ::tcflag_t = 0x00004000; +pub const XTABS: ::tcflag_t = 0o014000; + #[link(name = "util")] extern { pub fn sysctl(name: *mut ::c_int, diff --git a/src/unix/notbsd/mod.rs b/src/unix/notbsd/mod.rs index e10d28b304d70..8fa3750406e1b 100644 --- a/src/unix/notbsd/mod.rs +++ b/src/unix/notbsd/mod.rs @@ -680,6 +680,11 @@ pub const OPOST: ::tcflag_t = 0x1; pub const CS5: ::tcflag_t = 0x00000000; pub const CRTSCTS: ::tcflag_t = 0x80000000; pub const ECHO: ::tcflag_t = 0x00000008; +pub const OCRNL: ::tcflag_t = 0o000010; +pub const ONOCR: ::tcflag_t = 0o000020; +pub const ONLRET: ::tcflag_t = 0o000040; +pub const OFILL: ::tcflag_t = 0o000100; +pub const OFDEL: ::tcflag_t = 0o000200; pub const CLONE_VM: ::c_int = 0x100; pub const CLONE_FS: ::c_int = 0x200; From bd7dfd133bc857852366f9c8d2425ea1bd7208b5 Mon Sep 17 00:00:00 2001 From: Bryant Mairs Date: Thu, 22 Jun 2017 12:15:15 -0700 Subject: [PATCH 2/4] Add termios control character indices --- src/unix/bsd/freebsdlike/dragonfly/mod.rs | 2 ++ src/unix/bsd/freebsdlike/mod.rs | 1 + src/unix/bsd/mod.rs | 3 +++ src/unix/haiku/mod.rs | 13 +++++++++++++ src/unix/notbsd/android/mod.rs | 1 + src/unix/notbsd/linux/mips/mod.rs | 1 + src/unix/notbsd/linux/mod.rs | 2 ++ src/unix/notbsd/linux/musl/mod.rs | 1 + src/unix/notbsd/linux/other/b32/arm.rs | 1 + src/unix/notbsd/linux/other/b32/powerpc.rs | 1 + src/unix/notbsd/linux/other/b32/x86.rs | 1 + src/unix/notbsd/linux/other/b64/aarch64.rs | 1 + src/unix/notbsd/linux/other/b64/powerpc64.rs | 1 + src/unix/notbsd/linux/other/b64/sparc64.rs | 1 + src/unix/notbsd/linux/other/b64/x86_64.rs | 1 + src/unix/notbsd/linux/s390x.rs | 1 + 16 files changed, 32 insertions(+) diff --git a/src/unix/bsd/freebsdlike/dragonfly/mod.rs b/src/unix/bsd/freebsdlike/dragonfly/mod.rs index 889e77f0cea73..c7f0b956ca341 100644 --- a/src/unix/bsd/freebsdlike/dragonfly/mod.rs +++ b/src/unix/bsd/freebsdlike/dragonfly/mod.rs @@ -412,6 +412,8 @@ pub const AT_REMOVEDIR: ::c_int = 2; pub const AT_EACCESS: ::c_int = 4; pub const AT_SYMLINK_FOLLOW: ::c_int = 8; +pub const VCHECKPT: usize = 19; + extern { pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int; diff --git a/src/unix/bsd/freebsdlike/mod.rs b/src/unix/bsd/freebsdlike/mod.rs index 2929df0401213..22d31c7c58334 100644 --- a/src/unix/bsd/freebsdlike/mod.rs +++ b/src/unix/bsd/freebsdlike/mod.rs @@ -861,6 +861,7 @@ pub const EXTB: speed_t = 38400; pub const SEM_FAILED: *mut sem_t = 0 as *mut sem_t; pub const CRTSCTS: ::tcflag_t = 0x00030000; +pub const VERASE2: usize = 7; pub const OCRNL: ::tcflag_t = 0x10; pub const ONOCR: ::tcflag_t = 0x20; pub const ONLRET: ::tcflag_t = 0x40; diff --git a/src/unix/bsd/mod.rs b/src/unix/bsd/mod.rs index e14b5b5f65dfd..62679be5ceb9c 100644 --- a/src/unix/bsd/mod.rs +++ b/src/unix/bsd/mod.rs @@ -233,12 +233,15 @@ pub const VREPRINT: usize = 6; pub const VINTR: usize = 8; pub const VQUIT: usize = 9; pub const VSUSP: usize = 10; +pub const VDSUSP: usize = 11; pub const VSTART: usize = 12; pub const VSTOP: usize = 13; pub const VLNEXT: usize = 14; pub const VDISCARD: usize = 15; pub const VMIN: usize = 16; pub const VTIME: usize = 17; +pub const VSTATUS: usize = 18; +pub const _POSIX_VDISABLE: ::cc_t = 0xff; pub const IGNBRK: ::tcflag_t = 0x00000001; pub const BRKINT: ::tcflag_t = 0x00000002; pub const IGNPAR: ::tcflag_t = 0x00000004; diff --git a/src/unix/haiku/mod.rs b/src/unix/haiku/mod.rs index 6734795c22983..e3bb9ab8f8c80 100644 --- a/src/unix/haiku/mod.rs +++ b/src/unix/haiku/mod.rs @@ -686,6 +686,19 @@ pub const P_ALL: idtype_t = 0; pub const P_PID: idtype_t = 1; pub const P_PGID: idtype_t = 2; +pub const VINTR: usize = 0; +pub const VQUIT: usize = 1; +pub const VERASE: usize = 2; +pub const VKILL: usize = 3; +pub const VEOF: usize = 4; +pub const VEOL: usize = 5; +pub const VMIN: usize = 4; +pub const VTIME: usize = 5; +pub const VEOL2: usize = 6; +pub const VSWTCH: usize = 7; +pub const VSTART: usize = 8; +pub const VSTOP: usize = 9; +pub const VSUSP: usize = 10; pub const OLCUC: ::tcflag_t = 0o000002; pub const OCRNL: ::tcflag_t = 0o000010; pub const ONOCR: ::tcflag_t = 0o000020; diff --git a/src/unix/notbsd/android/mod.rs b/src/unix/notbsd/android/mod.rs index 2fb131b103d0d..d4f73cdb38dcc 100644 --- a/src/unix/notbsd/android/mod.rs +++ b/src/unix/notbsd/android/mod.rs @@ -626,6 +626,7 @@ pub const ISIG: ::tcflag_t = 0x00000001; pub const ICANON: ::tcflag_t = 0x00000002; pub const PENDIN: ::tcflag_t = 0x00004000; pub const NOFLSH: ::tcflag_t = 0x00000080; +pub const VSWTC: usize = 7; pub const OLCUC: ::tcflag_t = 0o000002; pub const NLDLY: ::tcflag_t = 0o000400; pub const CRDLY: ::tcflag_t = 0o003000; diff --git a/src/unix/notbsd/linux/mips/mod.rs b/src/unix/notbsd/linux/mips/mod.rs index 8555cce3cf3b2..9ca0ee2f31bcd 100644 --- a/src/unix/notbsd/linux/mips/mod.rs +++ b/src/unix/notbsd/linux/mips/mod.rs @@ -492,6 +492,7 @@ pub const PENDIN: ::tcflag_t = 0x00004000; pub const NOFLSH: ::tcflag_t = 0x00000080; pub const CIBAUD: ::tcflag_t = 0o02003600000; pub const CBAUDEX: ::tcflag_t = 0o010000; +pub const VSWTC: usize = 7; pub const OLCUC: ::tcflag_t = 0o000002; pub const NLDLY: ::tcflag_t = 0o000400; pub const CRDLY: ::tcflag_t = 0o003000; diff --git a/src/unix/notbsd/linux/mod.rs b/src/unix/notbsd/linux/mod.rs index 7404f2ce43af7..6e207a40778e8 100644 --- a/src/unix/notbsd/linux/mod.rs +++ b/src/unix/notbsd/linux/mod.rs @@ -711,6 +711,8 @@ pub const ITIMER_PROF: ::c_int = 2; pub const XATTR_CREATE: ::c_int = 0x1; pub const XATTR_REPLACE: ::c_int = 0x2; +pub const _POSIX_VDISABLE: ::cc_t = 0; + // On Linux, libc doesn't define this constant, libattr does instead. // We still define it for Linux as it's defined by libc on other platforms, // and it's mentioned in the man pages for getxattr and setxattr. diff --git a/src/unix/notbsd/linux/musl/mod.rs b/src/unix/notbsd/linux/musl/mod.rs index 31ea45e800452..7a1dcb9b5d67d 100644 --- a/src/unix/notbsd/linux/musl/mod.rs +++ b/src/unix/notbsd/linux/musl/mod.rs @@ -283,6 +283,7 @@ pub const NOFLSH: ::tcflag_t = 0x00000080; pub const CMSPAR: ::tcflag_t = 0o10000000000; pub const CIBAUD: ::tcflag_t = 0o02003600000; pub const CBAUDEX: ::tcflag_t = 0o010000; +pub const VSWTC: usize = 7; pub const OLCUC: ::tcflag_t = 0o000002; pub const NLDLY: ::tcflag_t = 0o000400; pub const CRDLY: ::tcflag_t = 0o003000; diff --git a/src/unix/notbsd/linux/other/b32/arm.rs b/src/unix/notbsd/linux/other/b32/arm.rs index ec376927dc879..830fcaac1104d 100644 --- a/src/unix/notbsd/linux/other/b32/arm.rs +++ b/src/unix/notbsd/linux/other/b32/arm.rs @@ -143,6 +143,7 @@ pub const PENDIN: ::tcflag_t = 0x00004000; pub const NOFLSH: ::tcflag_t = 0x00000080; pub const CIBAUD: ::tcflag_t = 0o02003600000; pub const CBAUDEX: ::tcflag_t = 0o010000; +pub const VSWTC: usize = 7; pub const OLCUC: ::tcflag_t = 0o000002; pub const NLDLY: ::tcflag_t = 0o000400; pub const CRDLY: ::tcflag_t = 0o003000; diff --git a/src/unix/notbsd/linux/other/b32/powerpc.rs b/src/unix/notbsd/linux/other/b32/powerpc.rs index cb15857aeb57a..d658a5bcf5e92 100644 --- a/src/unix/notbsd/linux/other/b32/powerpc.rs +++ b/src/unix/notbsd/linux/other/b32/powerpc.rs @@ -144,6 +144,7 @@ pub const ISIG: ::tcflag_t = 0x80; pub const ICANON: ::tcflag_t = 0x100; pub const PENDIN: ::tcflag_t = 0x20000000; pub const NOFLSH: ::tcflag_t = 0x80000000; +pub const VSWTC: usize = 9; pub const OLCUC: ::tcflag_t = 0o000004; pub const NLDLY: ::tcflag_t = 0o001400; pub const CRDLY: ::tcflag_t = 0o030000; diff --git a/src/unix/notbsd/linux/other/b32/x86.rs b/src/unix/notbsd/linux/other/b32/x86.rs index d55d4408a0211..04f0d47675a76 100644 --- a/src/unix/notbsd/linux/other/b32/x86.rs +++ b/src/unix/notbsd/linux/other/b32/x86.rs @@ -249,6 +249,7 @@ pub const PENDIN: ::tcflag_t = 0x00004000; pub const NOFLSH: ::tcflag_t = 0x00000080; pub const CIBAUD: ::tcflag_t = 0o02003600000; pub const CBAUDEX: ::tcflag_t = 0o010000; +pub const VSWTC: usize = 7; pub const OLCUC: ::tcflag_t = 0o000002; pub const NLDLY: ::tcflag_t = 0o000400; pub const CRDLY: ::tcflag_t = 0o003000; diff --git a/src/unix/notbsd/linux/other/b64/aarch64.rs b/src/unix/notbsd/linux/other/b64/aarch64.rs index a8d0f8dae584a..a3ca9481d66f6 100644 --- a/src/unix/notbsd/linux/other/b64/aarch64.rs +++ b/src/unix/notbsd/linux/other/b64/aarch64.rs @@ -387,6 +387,7 @@ pub const PENDIN: ::tcflag_t = 0x00004000; pub const NOFLSH: ::tcflag_t = 0x00000080; pub const CIBAUD: ::tcflag_t = 0o02003600000; pub const CBAUDEX: ::tcflag_t = 0o010000; +pub const VSWTC: usize = 7; pub const OLCUC: ::tcflag_t = 0o000002; pub const NLDLY: ::tcflag_t = 0o000400; pub const CRDLY: ::tcflag_t = 0o003000; diff --git a/src/unix/notbsd/linux/other/b64/powerpc64.rs b/src/unix/notbsd/linux/other/b64/powerpc64.rs index 8899a004715e3..719412ef8e362 100644 --- a/src/unix/notbsd/linux/other/b64/powerpc64.rs +++ b/src/unix/notbsd/linux/other/b64/powerpc64.rs @@ -383,6 +383,7 @@ pub const ISIG: ::tcflag_t = 0x80; pub const ICANON: ::tcflag_t = 0x100; pub const PENDIN: ::tcflag_t = 0x20000000; pub const NOFLSH: ::tcflag_t = 0x80000000; +pub const VSWTC: usize = 9; pub const OLCUC: ::tcflag_t = 0o000004; pub const NLDLY: ::tcflag_t = 0o001400; pub const CRDLY: ::tcflag_t = 0o030000; diff --git a/src/unix/notbsd/linux/other/b64/sparc64.rs b/src/unix/notbsd/linux/other/b64/sparc64.rs index c9c3484c10782..1edda700138c9 100644 --- a/src/unix/notbsd/linux/other/b64/sparc64.rs +++ b/src/unix/notbsd/linux/other/b64/sparc64.rs @@ -344,6 +344,7 @@ pub const PENDIN: ::tcflag_t = 0x4000; pub const NOFLSH: ::tcflag_t = 0x80; pub const CIBAUD: ::tcflag_t = 0o02003600000; pub const CBAUDEX: ::tcflag_t = 0x00001000; +pub const VSWTC: usize = 7; pub const OLCUC: ::tcflag_t = 0o000002; pub const NLDLY: ::tcflag_t = 0o000400; pub const CRDLY: ::tcflag_t = 0o003000; diff --git a/src/unix/notbsd/linux/other/b64/x86_64.rs b/src/unix/notbsd/linux/other/b64/x86_64.rs index 74f4b5a7d58c9..228258f2f0058 100644 --- a/src/unix/notbsd/linux/other/b64/x86_64.rs +++ b/src/unix/notbsd/linux/other/b64/x86_64.rs @@ -507,6 +507,7 @@ pub const PENDIN: ::tcflag_t = 0x00004000; pub const NOFLSH: ::tcflag_t = 0x00000080; pub const CIBAUD: ::tcflag_t = 0o02003600000; pub const CBAUDEX: ::tcflag_t = 0o010000; +pub const VSWTC: usize = 7; pub const OLCUC: ::tcflag_t = 0o000002; pub const NLDLY: ::tcflag_t = 0o000400; pub const CRDLY: ::tcflag_t = 0o003000; diff --git a/src/unix/notbsd/linux/s390x.rs b/src/unix/notbsd/linux/s390x.rs index e77ff5c5c0843..940b762134b2a 100644 --- a/src/unix/notbsd/linux/s390x.rs +++ b/src/unix/notbsd/linux/s390x.rs @@ -693,6 +693,7 @@ pub const SYS_gettid: ::c_long = 236; pub const SYS_perf_event_open: ::c_long = 331; pub const CMSPAR: ::tcflag_t = 0o10000000000; +pub const VSWTC: usize = 7; pub const OLCUC: ::tcflag_t = 0o000002; pub const NLDLY: ::tcflag_t = 0o000400; pub const NL1: ::tcflag_t = 0x00000100; From cb53d72581536acdf70d6f6504a450c9242b2f9b Mon Sep 17 00:00:00 2001 From: Bryant Mairs Date: Thu, 22 Jun 2017 12:16:15 -0700 Subject: [PATCH 3/4] Add termios control flags --- src/unix/bsd/freebsdlike/mod.rs | 5 +++++ src/unix/bsd/mod.rs | 2 ++ src/unix/bsd/netbsdlike/mod.rs | 3 +++ src/unix/bsd/netbsdlike/netbsd/mod.rs | 4 ++-- src/unix/bsd/netbsdlike/openbsdlike/mod.rs | 1 + src/unix/notbsd/android/mod.rs | 4 ++++ src/unix/notbsd/linux/other/mod.rs | 2 ++ 7 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/unix/bsd/freebsdlike/mod.rs b/src/unix/bsd/freebsdlike/mod.rs index 22d31c7c58334..bb74182f58607 100644 --- a/src/unix/bsd/freebsdlike/mod.rs +++ b/src/unix/bsd/freebsdlike/mod.rs @@ -861,6 +861,11 @@ pub const EXTB: speed_t = 38400; pub const SEM_FAILED: *mut sem_t = 0 as *mut sem_t; pub const CRTSCTS: ::tcflag_t = 0x00030000; +pub const CCTS_OFLOW: ::tcflag_t = 0x00010000; +pub const CRTS_IFLOW: ::tcflag_t = 0x00020000; +pub const CDTR_IFLOW: ::tcflag_t = 0x00040000; +pub const CDSR_OFLOW: ::tcflag_t = 0x00080000; +pub const CCAR_OFLOW: ::tcflag_t = 0x00100000; pub const VERASE2: usize = 7; pub const OCRNL: ::tcflag_t = 0x10; pub const ONOCR: ::tcflag_t = 0x20; diff --git a/src/unix/bsd/mod.rs b/src/unix/bsd/mod.rs index 62679be5ceb9c..73b229daac851 100644 --- a/src/unix/bsd/mod.rs +++ b/src/unix/bsd/mod.rs @@ -259,6 +259,7 @@ pub const OPOST: ::tcflag_t = 0x1; pub const ONLCR: ::tcflag_t = 0x2; pub const OXTABS: ::tcflag_t = 0x4; pub const ONOEOT: ::tcflag_t = 0x8; +pub const CIGNORE: ::tcflag_t = 0x00000001; pub const CSIZE: ::tcflag_t = 0x00000300; pub const CS5: ::tcflag_t = 0x00000000; pub const CS6: ::tcflag_t = 0x00000100; @@ -285,6 +286,7 @@ pub const TOSTOP: ::tcflag_t = 0x00400000; pub const FLUSHO: ::tcflag_t = 0x00800000; pub const PENDIN: ::tcflag_t = 0x20000000; pub const NOFLSH: ::tcflag_t = 0x80000000; +pub const MDMBUF: ::tcflag_t = 0x00100000; pub const WNOHANG: ::c_int = 0x00000001; pub const WUNTRACED: ::c_int = 0x00000002; diff --git a/src/unix/bsd/netbsdlike/mod.rs b/src/unix/bsd/netbsdlike/mod.rs index 789e7c4237a67..f93dc292c9dbd 100644 --- a/src/unix/bsd/netbsdlike/mod.rs +++ b/src/unix/bsd/netbsdlike/mod.rs @@ -538,6 +538,9 @@ pub const EXTB: speed_t = 38400; pub const SEM_FAILED: *mut sem_t = 0 as *mut sem_t; +pub const CRTSCTS: ::tcflag_t = 0x00010000; +pub const CRTS_IFLOW: ::tcflag_t = CRTSCTS; +pub const CCTS_OFLOW: ::tcflag_t = CRTSCTS; pub const OCRNL: ::tcflag_t = 0x10; f! { diff --git a/src/unix/bsd/netbsdlike/netbsd/mod.rs b/src/unix/bsd/netbsdlike/netbsd/mod.rs index 5b3a6e62fc209..bfec892ef871a 100644 --- a/src/unix/bsd/netbsdlike/netbsd/mod.rs +++ b/src/unix/bsd/netbsdlike/netbsd/mod.rs @@ -463,8 +463,6 @@ pub const NOTE_TRACK: ::uint32_t = 0x00000001; pub const NOTE_TRACKERR: ::uint32_t = 0x00000002; pub const NOTE_CHILD: ::uint32_t = 0x00000004; -pub const CRTSCTS: ::tcflag_t = 0x00010000; - pub const TMP_MAX : ::c_uint = 308915776; pub const NI_MAXHOST: ::socklen_t = 1025; @@ -646,6 +644,8 @@ pub const B921600: ::speed_t = 921600; pub const ONOCR: ::tcflag_t = 0x20; pub const ONLRET: ::tcflag_t = 0x40; +pub const CDTRCTS: ::tcflag_t = 0x00020000; +pub const CHWFLOW: ::tcflag_t = ::MDMBUF | ::CRTSCTS | ::CDTRCTS; // dirfd() is a macro on netbsd to access // the first field of the struct where dirp points to: diff --git a/src/unix/bsd/netbsdlike/openbsdlike/mod.rs b/src/unix/bsd/netbsdlike/openbsdlike/mod.rs index b9ef3cf9226f9..0ad021a5020ed 100644 --- a/src/unix/bsd/netbsdlike/openbsdlike/mod.rs +++ b/src/unix/bsd/netbsdlike/openbsdlike/mod.rs @@ -460,6 +460,7 @@ pub const KI_WMESGLEN: ::c_int = 8; pub const KI_MAXLOGNAME: ::c_int = 32; pub const KI_EMULNAMELEN: ::c_int = 8; +pub const CHWFLOW: ::tcflag_t = ::MDMBUF | ::CRTSCTS; pub const OLCUC: ::tcflag_t = 0x20; pub const ONOCR: ::tcflag_t = 0x40; pub const ONLRET: ::tcflag_t = 0x80; diff --git a/src/unix/notbsd/android/mod.rs b/src/unix/notbsd/android/mod.rs index d4f73cdb38dcc..48fa7950cff52 100644 --- a/src/unix/notbsd/android/mod.rs +++ b/src/unix/notbsd/android/mod.rs @@ -733,6 +733,10 @@ pub const NLA_TYPE_MASK: ::c_int = !(NLA_F_NESTED | NLA_F_NET_BYTEORDER); pub const SIGEV_THREAD_ID: ::c_int = 4; +pub const CMSPAR: ::tcflag_t = 0o10000000000; +pub const CIBAUD: ::tcflag_t = 0o02003600000; +pub const CBAUDEX: ::tcflag_t = 0o010000; + f! { pub fn CPU_ZERO(cpuset: &mut cpu_set_t) -> () { for slot in cpuset.__bits.iter_mut() { diff --git a/src/unix/notbsd/linux/other/mod.rs b/src/unix/notbsd/linux/other/mod.rs index b7a11a85e9627..751be6b1cec25 100644 --- a/src/unix/notbsd/linux/other/mod.rs +++ b/src/unix/notbsd/linux/other/mod.rs @@ -443,6 +443,8 @@ pub const NLA_F_NESTED: ::c_int = 1 << 15; pub const NLA_F_NET_BYTEORDER: ::c_int = 1 << 14; pub const NLA_TYPE_MASK: ::c_int = !(NLA_F_NESTED | NLA_F_NET_BYTEORDER); +pub const CMSPAR: ::tcflag_t = 0o10000000000; + cfg_if! { if #[cfg(any(target_arch = "arm", target_arch = "x86", target_arch = "x86_64"))] { From 297d5b7d03fac425c18644f03cd2fc8fc93b7a39 Mon Sep 17 00:00:00 2001 From: Bryant Mairs Date: Thu, 22 Jun 2017 12:16:47 -0700 Subject: [PATCH 4/4] Add termios local flags --- src/unix/bsd/mod.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/unix/bsd/mod.rs b/src/unix/bsd/mod.rs index 73b229daac851..ec65f9ea92831 100644 --- a/src/unix/bsd/mod.rs +++ b/src/unix/bsd/mod.rs @@ -280,10 +280,12 @@ pub const ECHOPRT: ::tcflag_t = 0x00000020; pub const ECHOCTL: ::tcflag_t = 0x00000040; pub const ISIG: ::tcflag_t = 0x00000080; pub const ICANON: ::tcflag_t = 0x00000100; +pub const ALTWERASE: ::tcflag_t = 0x00000200; pub const IEXTEN: ::tcflag_t = 0x00000400; pub const EXTPROC: ::tcflag_t = 0x00000800; pub const TOSTOP: ::tcflag_t = 0x00400000; pub const FLUSHO: ::tcflag_t = 0x00800000; +pub const NOKERNINFO: ::tcflag_t = 0x02000000; pub const PENDIN: ::tcflag_t = 0x20000000; pub const NOFLSH: ::tcflag_t = 0x80000000; pub const MDMBUF: ::tcflag_t = 0x00100000;