Skip to content

Commit 0a64d24

Browse files
committed
Add ioctl constants
1 parent fb83189 commit 0a64d24

File tree

2 files changed

+67
-6
lines changed

2 files changed

+67
-6
lines changed

src/unix/notbsd/android/mod.rs

Lines changed: 35 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;
@@ -473,6 +470,38 @@ pub const F_GETLK: ::c_int = 5;
473470
pub const F_GETOWN: ::c_int = 9;
474471
pub const F_SETOWN: ::c_int = 8;
475472

473+
pub const TCGETS: ::c_int = 0x5401;
474+
pub const TCSETS: ::c_int = 0x5402;
475+
pub const TCSETSW: ::c_int = 0x5403;
476+
pub const TCSETSF: ::c_int = 0x5404;
477+
pub const TCGETA: ::c_int = 0x5405;
478+
pub const TCSETA: ::c_int = 0x5406;
479+
pub const TCSETAW: ::c_int = 0x5407;
480+
pub const TCSETAF: ::c_int = 0x5408;
481+
pub const TCSBRK: ::c_int = 0x5409;
482+
pub const TCXONC: ::c_int = 0x540A;
483+
pub const TCFLSH: ::c_int = 0x540B;
484+
pub const TIOCGSOFTCAR: ::c_int = 0x5419;
485+
pub const TIOCSSOFTCAR: ::c_int = 0x541A;
486+
pub const TIOCINQ: ::c_int = 0x541B;
487+
pub const TIOCLINUX: ::c_int = 0x541C;
488+
pub const TIOCGSERIAL: ::c_int = 0x541E;
489+
pub const TIOCEXCL: ::c_int = 0x540C;
490+
pub const TIOCNXCL: ::c_int = 0x540D;
491+
pub const TIOCSCTTY: ::c_int = 0x540E;
492+
pub const TIOCGPGRP: ::c_int = 0x540F;
493+
pub const TIOCSPGRP: ::c_int = 0x5410;
494+
pub const TIOCOUTQ: ::c_int = 0x5411;
495+
pub const TIOCSTI: ::c_int = 0x5412;
496+
pub const TIOCGWINSZ: ::c_int = 0x5413;
497+
pub const TIOCSWINSZ: ::c_int = 0x5414;
498+
pub const TIOCMGET: ::c_int = 0x5415;
499+
pub const TIOCMBIS: ::c_int = 0x5416;
500+
pub const TIOCMBIC: ::c_int = 0x5417;
501+
pub const TIOCMSET: ::c_int = 0x5418;
502+
pub const FIONREAD: ::c_int = 0x541B;
503+
pub const TIOCCONS: ::c_int = 0x541D;
504+
476505
f! {
477506
pub fn sigemptyset(set: *mut sigset_t) -> ::c_int {
478507
*set = 0;
@@ -508,18 +537,18 @@ f! {
508537
return 0
509538
}
510539
pub fn tcgetattr(fd: ::c_int, termios: *mut ::termios) -> ::c_int {
511-
ioctl(fd, TCGETS, termios)
540+
ioctl(fd, ::TCGETS, termios)
512541
}
513542
pub fn tcsetattr(fd: ::c_int,
514543
optional_actions: ::c_int,
515544
termios: *const ::termios) -> ::c_int {
516545
ioctl(fd, optional_actions, termios)
517546
}
518547
pub fn tcflow(fd: ::c_int, action: ::c_int) -> ::c_int {
519-
ioctl(fd, TCXONC, action as *mut ::c_void)
548+
ioctl(fd, ::TCXONC, action as *mut ::c_void)
520549
}
521550
pub fn tcflush(fd: ::c_int, action: ::c_int) -> ::c_int {
522-
ioctl(fd, TCFLSH, action as *mut ::c_void)
551+
ioctl(fd, ::TCFLSH, action as *mut ::c_void)
523552
}
524553
pub fn tcsendbreak(fd: ::c_int, duration: ::c_int) -> ::c_int {
525554
ioctl(fd, TCSBRKP, duration as *mut ::c_void)

src/unix/notbsd/linux/mod.rs

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,38 @@ pub const CLONE_NEWPID: ::c_uint = 0x20000000;
389389
pub const CLONE_NEWNET: ::c_uint = 0x40000000;
390390
pub const CLONE_IO: ::c_uint = 0x80000000;
391391

392+
pub const TCGETS: ::c_ulong = 0x5401;
393+
pub const TCSETS: ::c_ulong = 0x5402;
394+
pub const TCSETSW: ::c_ulong = 0x5403;
395+
pub const TCSETSF: ::c_ulong = 0x5404;
396+
pub const TCGETA: ::c_ulong = 0x5405;
397+
pub const TCSETA: ::c_ulong = 0x5406;
398+
pub const TCSETAW: ::c_ulong = 0x5407;
399+
pub const TCSETAF: ::c_ulong = 0x5408;
400+
pub const TCSBRK: ::c_ulong = 0x5409;
401+
pub const TCXONC: ::c_ulong = 0x540A;
402+
pub const TCFLSH: ::c_ulong = 0x540B;
403+
pub const TIOCGSOFTCAR: ::c_ulong = 0x5419;
404+
pub const TIOCSSOFTCAR: ::c_ulong = 0x541A;
405+
pub const TIOCINQ: ::c_ulong = 0x541B;
406+
pub const TIOCLINUX: ::c_ulong = 0x541C;
407+
pub const TIOCGSERIAL: ::c_ulong = 0x541E;
408+
pub const TIOCEXCL: ::c_ulong = 0x540C;
409+
pub const TIOCNXCL: ::c_ulong = 0x540D;
410+
pub const TIOCSCTTY: ::c_ulong = 0x540E;
411+
pub const TIOCGPGRP: ::c_ulong = 0x540F;
412+
pub const TIOCSPGRP: ::c_ulong = 0x5410;
413+
pub const TIOCOUTQ: ::c_ulong = 0x5411;
414+
pub const TIOCSTI: ::c_ulong = 0x5412;
415+
pub const TIOCGWINSZ: ::c_ulong = 0x5413;
416+
pub const TIOCSWINSZ: ::c_ulong = 0x5414;
417+
pub const TIOCMGET: ::c_ulong = 0x5415;
418+
pub const TIOCMBIS: ::c_ulong = 0x5416;
419+
pub const TIOCMBIC: ::c_ulong = 0x5417;
420+
pub const TIOCMSET: ::c_ulong = 0x5418;
421+
pub const FIONREAD: ::c_ulong = 0x541B;
422+
pub const TIOCCONS: ::c_ulong = 0x541D;
423+
392424
extern {
393425
pub fn shm_open(name: *const c_char, oflag: ::c_int,
394426
mode: mode_t) -> ::c_int;

0 commit comments

Comments
 (0)