Skip to content

Commit 1af26db

Browse files
committed
Auto merge of rust-lang#636 - Susurrus:termios_ioctl, r=alexcrichton
Add constants for termios ioctls These should be `c_int` from what I could see for Linux and I assumed the others were the same.
2 parents 77e0da5 + 82dc2f3 commit 1af26db

File tree

11 files changed

+132
-0
lines changed

11 files changed

+132
-0
lines changed

src/unix/bsd/netbsdlike/mod.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -542,6 +542,18 @@ pub const CRTS_IFLOW: ::tcflag_t = CRTSCTS;
542542
pub const CCTS_OFLOW: ::tcflag_t = CRTSCTS;
543543
pub const OCRNL: ::tcflag_t = 0x10;
544544

545+
pub const TIOCM_LE: ::c_int = 0o0001;
546+
pub const TIOCM_DTR: ::c_int = 0o0002;
547+
pub const TIOCM_RTS: ::c_int = 0o0004;
548+
pub const TIOCM_ST: ::c_int = 0o0010;
549+
pub const TIOCM_SR: ::c_int = 0o0020;
550+
pub const TIOCM_CTS: ::c_int = 0o0040;
551+
pub const TIOCM_CAR: ::c_int = 0o0100;
552+
pub const TIOCM_RNG: ::c_int = 0o0200;
553+
pub const TIOCM_DSR: ::c_int = 0o0400;
554+
pub const TIOCM_CD: ::c_int = TIOCM_CAR;
555+
pub const TIOCM_RI: ::c_int = TIOCM_RNG;
556+
545557
f! {
546558
pub fn WSTOPSIG(status: ::c_int) -> ::c_int {
547559
status >> 8

src/unix/haiku/mod.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -729,6 +729,18 @@ pub const VTDLY: ::tcflag_t = 0o040000;
729729
pub const VT0: ::tcflag_t = 0o000000;
730730
pub const VT1: ::tcflag_t = 0o040000;
731731

732+
pub const TCGB_CTS: ::c_int = 0x01;
733+
pub const TCGB_DSR: ::c_int = 0x02;
734+
pub const TCGB_RI: ::c_int = 0x04;
735+
pub const TCGB_DCD: ::c_int = 0x08;
736+
pub const TIOCM_CTS: ::c_int = TCGB_CTS;
737+
pub const TIOCM_CD: ::c_int = TCGB_DCD;
738+
pub const TIOCM_CAR: ::c_int = TIOCM_CD;
739+
pub const TIOCM_RI: ::c_int = TCGB_RI;
740+
pub const TIOCM_DSR: ::c_int = TCGB_dsR;
741+
pub const TIOCM_DTR: ::c_int = 0x10;
742+
pub const TIOCM_RTS: ::c_int = 0x20;
743+
732744
f! {
733745
pub fn FD_CLR(fd: ::c_int, set: *mut fd_set) -> () {
734746
let fd = fd as usize;

src/unix/notbsd/android/mod.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -781,6 +781,18 @@ pub const CMSPAR: ::tcflag_t = 0o10000000000;
781781
pub const CIBAUD: ::tcflag_t = 0o02003600000;
782782
pub const CBAUDEX: ::tcflag_t = 0o010000;
783783

784+
pub const TIOCM_LE: ::c_int = 0x001;
785+
pub const TIOCM_DTR: ::c_int = 0x002;
786+
pub const TIOCM_RTS: ::c_int = 0x004;
787+
pub const TIOCM_ST: ::c_int = 0x008;
788+
pub const TIOCM_SR: ::c_int = 0x010;
789+
pub const TIOCM_CTS: ::c_int = 0x020;
790+
pub const TIOCM_CAR: ::c_int = 0x040;
791+
pub const TIOCM_RNG: ::c_int = 0x080;
792+
pub const TIOCM_DSR: ::c_int = 0x100;
793+
pub const TIOCM_CD: ::c_int = TIOCM_CAR;
794+
pub const TIOCM_RI: ::c_int = TIOCM_RNG;
795+
784796
f! {
785797
pub fn CPU_ZERO(cpuset: &mut cpu_set_t) -> () {
786798
for slot in cpuset.__bits.iter_mut() {

src/unix/notbsd/linux/mips/mod.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -610,6 +610,18 @@ pub const B3000000: ::speed_t = 0o010015;
610610
pub const B3500000: ::speed_t = 0o010016;
611611
pub const B4000000: ::speed_t = 0o010017;
612612

613+
pub const TIOCM_LE: ::c_int = 0x001;
614+
pub const TIOCM_DTR: ::c_int = 0x002;
615+
pub const TIOCM_RTS: ::c_int = 0x004;
616+
pub const TIOCM_ST: ::c_int = 0x010;
617+
pub const TIOCM_SR: ::c_int = 0x020;
618+
pub const TIOCM_CTS: ::c_int = 0x040;
619+
pub const TIOCM_CAR: ::c_int = 0x100;
620+
pub const TIOCM_CD: ::c_int = TIOCM_CAR;
621+
pub const TIOCM_RNG: ::c_int = 0x200;
622+
pub const TIOCM_RI: ::c_int = TIOCM_RNG;
623+
pub const TIOCM_DSR: ::c_int = 0x400;
624+
613625
#[link(name = "util")]
614626
extern {
615627
pub fn sysctl(name: *mut ::c_int,

src/unix/notbsd/linux/musl/b32/arm.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,3 +344,15 @@ pub const SYS_perf_event_open: ::c_long = 364;
344344

345345
pub const POLLWRNORM: ::c_short = 0x100;
346346
pub const POLLWRBAND: ::c_short = 0x200;
347+
348+
pub const TIOCM_LE: ::c_int = 0x001;
349+
pub const TIOCM_DTR: ::c_int = 0x002;
350+
pub const TIOCM_RTS: ::c_int = 0x004;
351+
pub const TIOCM_ST: ::c_int = 0x008;
352+
pub const TIOCM_SR: ::c_int = 0x010;
353+
pub const TIOCM_CTS: ::c_int = 0x020;
354+
pub const TIOCM_CAR: ::c_int = 0x040;
355+
pub const TIOCM_RNG: ::c_int = 0x080;
356+
pub const TIOCM_DSR: ::c_int = 0x100;
357+
pub const TIOCM_CD: ::c_int = TIOCM_CAR;
358+
pub const TIOCM_RI: ::c_int = TIOCM_RNG;

src/unix/notbsd/linux/musl/b32/asmjs.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,3 +334,15 @@ pub const SYS_gettid: ::c_long = 224; // Valid for arm (32-bit) and x86 (32-bit)
334334

335335
pub const POLLWRNORM: ::c_short = 0x100;
336336
pub const POLLWRBAND: ::c_short = 0x200;
337+
338+
pub const TIOCM_LE: ::c_int = 0x001;
339+
pub const TIOCM_DTR: ::c_int = 0x002;
340+
pub const TIOCM_RTS: ::c_int = 0x004;
341+
pub const TIOCM_ST: ::c_int = 0x008;
342+
pub const TIOCM_SR: ::c_int = 0x010;
343+
pub const TIOCM_CTS: ::c_int = 0x020;
344+
pub const TIOCM_CAR: ::c_int = 0x040;
345+
pub const TIOCM_RNG: ::c_int = 0x080;
346+
pub const TIOCM_DSR: ::c_int = 0x100;
347+
pub const TIOCM_CD: ::c_int = TIOCM_CAR;
348+
pub const TIOCM_RI: ::c_int = TIOCM_RNG;

src/unix/notbsd/linux/musl/b32/mips.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,3 +352,15 @@ pub const SYS_perf_event_open: ::c_long = 4333; // Valid for O32
352352

353353
pub const POLLWRNORM: ::c_short = 0x4;
354354
pub const POLLWRBAND: ::c_short = 0x100;
355+
356+
pub const TIOCM_LE: ::c_int = 0x001;
357+
pub const TIOCM_DTR: ::c_int = 0x002;
358+
pub const TIOCM_RTS: ::c_int = 0x004;
359+
pub const TIOCM_ST: ::c_int = 0x010;
360+
pub const TIOCM_SR: ::c_int = 0x020;
361+
pub const TIOCM_CTS: ::c_int = 0x040;
362+
pub const TIOCM_CAR: ::c_int = 0x100;
363+
pub const TIOCM_CD: ::c_int = TIOCM_CAR;
364+
pub const TIOCM_RNG: ::c_int = 0x200;
365+
pub const TIOCM_RI: ::c_int = TIOCM_RNG;
366+
pub const TIOCM_DSR: ::c_int = 0x400;

src/unix/notbsd/linux/musl/b32/x86.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,3 +358,15 @@ pub const SYS_perf_event_open: ::c_long = 336;
358358

359359
pub const POLLWRNORM: ::c_short = 0x100;
360360
pub const POLLWRBAND: ::c_short = 0x200;
361+
362+
pub const TIOCM_LE: ::c_int = 0x001;
363+
pub const TIOCM_DTR: ::c_int = 0x002;
364+
pub const TIOCM_RTS: ::c_int = 0x004;
365+
pub const TIOCM_ST: ::c_int = 0x008;
366+
pub const TIOCM_SR: ::c_int = 0x010;
367+
pub const TIOCM_CTS: ::c_int = 0x020;
368+
pub const TIOCM_CAR: ::c_int = 0x040;
369+
pub const TIOCM_RNG: ::c_int = 0x080;
370+
pub const TIOCM_DSR: ::c_int = 0x100;
371+
pub const TIOCM_CD: ::c_int = TIOCM_CAR;
372+
pub const TIOCM_RI: ::c_int = TIOCM_RNG;

src/unix/notbsd/linux/musl/b64/mod.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,18 @@ pub const TIOCCONS: ::c_int = 0x541D;
371371
pub const POLLWRNORM: ::c_short = 0x100;
372372
pub const POLLWRBAND: ::c_short = 0x200;
373373

374+
pub const TIOCM_LE: ::c_int = 0x001;
375+
pub const TIOCM_DTR: ::c_int = 0x002;
376+
pub const TIOCM_RTS: ::c_int = 0x004;
377+
pub const TIOCM_ST: ::c_int = 0x008;
378+
pub const TIOCM_SR: ::c_int = 0x010;
379+
pub const TIOCM_CTS: ::c_int = 0x020;
380+
pub const TIOCM_CAR: ::c_int = 0x040;
381+
pub const TIOCM_RNG: ::c_int = 0x080;
382+
pub const TIOCM_DSR: ::c_int = 0x100;
383+
pub const TIOCM_CD: ::c_int = TIOCM_CAR;
384+
pub const TIOCM_RI: ::c_int = TIOCM_RNG;
385+
374386
cfg_if! {
375387
if #[cfg(target_arch = "aarch64")] {
376388
mod aarch64;

src/unix/notbsd/linux/other/mod.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,18 @@ pub const NLA_TYPE_MASK: ::c_int = !(NLA_F_NESTED | NLA_F_NET_BYTEORDER);
519519

520520
pub const CMSPAR: ::tcflag_t = 0o10000000000;
521521

522+
pub const TIOCM_LE: ::c_int = 0x001;
523+
pub const TIOCM_DTR: ::c_int = 0x002;
524+
pub const TIOCM_RTS: ::c_int = 0x004;
525+
pub const TIOCM_ST: ::c_int = 0x008;
526+
pub const TIOCM_SR: ::c_int = 0x010;
527+
pub const TIOCM_CTS: ::c_int = 0x020;
528+
pub const TIOCM_CAR: ::c_int = 0x040;
529+
pub const TIOCM_RNG: ::c_int = 0x080;
530+
pub const TIOCM_DSR: ::c_int = 0x100;
531+
pub const TIOCM_CD: ::c_int = TIOCM_CAR;
532+
pub const TIOCM_RI: ::c_int = TIOCM_RNG;
533+
522534
cfg_if! {
523535
if #[cfg(any(target_arch = "arm", target_arch = "x86",
524536
target_arch = "x86_64"))] {

src/unix/notbsd/linux/s390x.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -788,6 +788,18 @@ pub const VTDLY: ::tcflag_t = 0o040000;
788788
pub const VT1: ::tcflag_t = 0x00004000;
789789
pub const XTABS: ::tcflag_t = 0o014000;
790790

791+
pub const TIOCM_LE: ::c_int = 0x001;
792+
pub const TIOCM_DTR: ::c_int = 0x002;
793+
pub const TIOCM_RTS: ::c_int = 0x004;
794+
pub const TIOCM_ST: ::c_int = 0x008;
795+
pub const TIOCM_SR: ::c_int = 0x010;
796+
pub const TIOCM_CTS: ::c_int = 0x020;
797+
pub const TIOCM_CAR: ::c_int = 0x040;
798+
pub const TIOCM_RNG: ::c_int = 0x080;
799+
pub const TIOCM_DSR: ::c_int = 0x100;
800+
pub const TIOCM_CD: ::c_int = TIOCM_CAR;
801+
pub const TIOCM_RI: ::c_int = TIOCM_RNG;
802+
791803
#[link(name = "util")]
792804
extern {
793805
pub fn sysctl(name: *mut ::c_int,

0 commit comments

Comments
 (0)