Skip to content

Commit 7527f4b

Browse files
committed
Add ioctl constants
1 parent fb83189 commit 7527f4b

File tree

2 files changed

+35
-6
lines changed

2 files changed

+35
-6
lines changed

src/unix/notbsd/android/mod.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -395,10 +395,7 @@ pub const O_NDELAY: ::c_int = 0x800;
395395
pub const NI_MAXHOST: ::size_t = 1025;
396396

397397
pub const NCCS: usize = 19;
398-
pub const TCXONC: ::c_int = 0x540A;
399-
pub const TCFLSH: ::c_int = 0x540B;
400398
pub const TCSBRKP: ::c_int = 0x5425;
401-
pub const TCGETS: ::c_int = 0x5401;
402399
pub const TCSANOW: ::c_int = 0;
403400
pub const TCSADRAIN: ::c_int = 0x1;
404401
pub const TCSAFLUSH: ::c_int = 0x2;
@@ -508,18 +505,18 @@ f! {
508505
return 0
509506
}
510507
pub fn tcgetattr(fd: ::c_int, termios: *mut ::termios) -> ::c_int {
511-
ioctl(fd, TCGETS, termios)
508+
ioctl(fd, ::TCGETS, termios)
512509
}
513510
pub fn tcsetattr(fd: ::c_int,
514511
optional_actions: ::c_int,
515512
termios: *const ::termios) -> ::c_int {
516513
ioctl(fd, optional_actions, termios)
517514
}
518515
pub fn tcflow(fd: ::c_int, action: ::c_int) -> ::c_int {
519-
ioctl(fd, TCXONC, action as *mut ::c_void)
516+
ioctl(fd, ::TCXONC, action as *mut ::c_void)
520517
}
521518
pub fn tcflush(fd: ::c_int, action: ::c_int) -> ::c_int {
522-
ioctl(fd, TCFLSH, action as *mut ::c_void)
519+
ioctl(fd, ::TCFLSH, action as *mut ::c_void)
523520
}
524521
pub fn tcsendbreak(fd: ::c_int, duration: ::c_int) -> ::c_int {
525522
ioctl(fd, TCSBRKP, duration as *mut ::c_void)

src/unix/notbsd/mod.rs

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,38 @@ pub const CLONE_DETACHED: ::c_int = 0x400000;
522522
pub const CLONE_UNTRACED: ::c_int = 0x800000;
523523
pub const CLONE_CHILD_SETTID: ::c_int = 0x01000000;
524524

525+
pub const TCGETS: ::c_ulong = 0x5401;
526+
pub const TCSETS: ::c_ulong = 0x5402;
527+
pub const TCSETSW: ::c_ulong = 0x5403;
528+
pub const TCSETSF: ::c_ulong = 0x5404;
529+
pub const TCGETA: ::c_ulong = 0x5405;
530+
pub const TCSETA: ::c_ulong = 0x5406;
531+
pub const TCSETAW: ::c_ulong = 0x5407;
532+
pub const TCSETAF: ::c_ulong = 0x5408;
533+
pub const TCSBRK: ::c_ulong = 0x5409;
534+
pub const TCXONC: ::c_ulong = 0x540A;
535+
pub const TCFLSH: ::c_ulong = 0x540B;
536+
pub const TIOCGSOFTCAR: ::c_ulong = 0x5419;
537+
pub const TIOCSSOFTCAR: ::c_ulong = 0x541A;
538+
pub const TIOCINQ: ::c_ulong = 0x541B;
539+
pub const TIOCLINUX: ::c_ulong = 0x541C;
540+
pub const TIOCGSERIAL: ::c_ulong = 0x541E;
541+
pub const TIOCEXCL: ::c_ulong = 0x540C;
542+
pub const TIOCNXCL: ::c_ulong = 0x540D;
543+
pub const TIOCSCTTY: ::c_ulong = 0x540E;
544+
pub const TIOCGPGRP: ::c_ulong = 0x540F;
545+
pub const TIOCSPGRP: ::c_ulong = 0x5410;
546+
pub const TIOCOUTQ: ::c_ulong = 0x5411;
547+
pub const TIOCSTI: ::c_ulong = 0x5412;
548+
pub const TIOCGWINSZ: ::c_ulong = 0x5413;
549+
pub const TIOCSWINSZ: ::c_ulong = 0x5414;
550+
pub const TIOCMGET: ::c_ulong = 0x5415;
551+
pub const TIOCMBIS: ::c_ulong = 0x5416;
552+
pub const TIOCMBIC: ::c_ulong = 0x5417;
553+
pub const TIOCMSET: ::c_ulong = 0x5418;
554+
pub const FIONREAD: ::c_ulong = 0x541B;
555+
pub const TIOCCONS: ::c_ulong = 0x541D;
556+
525557
f! {
526558
pub fn FD_CLR(fd: ::c_int, set: *mut fd_set) -> () {
527559
let fd = fd as usize;

0 commit comments

Comments
 (0)