Skip to content

Commit 0422dba

Browse files
committed
Merge branch 'add_ioctl_constants' of https://github.com/derekdreery/libc into merge
2 parents a5d830a + 0a64d24 commit 0422dba

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
@@ -397,10 +397,7 @@ pub const O_NDELAY: ::c_int = 0x800;
397397
pub const NI_MAXHOST: ::size_t = 1025;
398398

399399
pub const NCCS: usize = 19;
400-
pub const TCXONC: ::c_int = 0x540A;
401-
pub const TCFLSH: ::c_int = 0x540B;
402400
pub const TCSBRKP: ::c_int = 0x5425;
403-
pub const TCGETS: ::c_int = 0x5401;
404401
pub const TCSANOW: ::c_int = 0;
405402
pub const TCSADRAIN: ::c_int = 0x1;
406403
pub const TCSAFLUSH: ::c_int = 0x2;
@@ -475,6 +472,38 @@ pub const F_GETLK: ::c_int = 5;
475472
pub const F_GETOWN: ::c_int = 9;
476473
pub const F_SETOWN: ::c_int = 8;
477474

475+
pub const TCGETS: ::c_int = 0x5401;
476+
pub const TCSETS: ::c_int = 0x5402;
477+
pub const TCSETSW: ::c_int = 0x5403;
478+
pub const TCSETSF: ::c_int = 0x5404;
479+
pub const TCGETA: ::c_int = 0x5405;
480+
pub const TCSETA: ::c_int = 0x5406;
481+
pub const TCSETAW: ::c_int = 0x5407;
482+
pub const TCSETAF: ::c_int = 0x5408;
483+
pub const TCSBRK: ::c_int = 0x5409;
484+
pub const TCXONC: ::c_int = 0x540A;
485+
pub const TCFLSH: ::c_int = 0x540B;
486+
pub const TIOCGSOFTCAR: ::c_int = 0x5419;
487+
pub const TIOCSSOFTCAR: ::c_int = 0x541A;
488+
pub const TIOCINQ: ::c_int = 0x541B;
489+
pub const TIOCLINUX: ::c_int = 0x541C;
490+
pub const TIOCGSERIAL: ::c_int = 0x541E;
491+
pub const TIOCEXCL: ::c_int = 0x540C;
492+
pub const TIOCNXCL: ::c_int = 0x540D;
493+
pub const TIOCSCTTY: ::c_int = 0x540E;
494+
pub const TIOCGPGRP: ::c_int = 0x540F;
495+
pub const TIOCSPGRP: ::c_int = 0x5410;
496+
pub const TIOCOUTQ: ::c_int = 0x5411;
497+
pub const TIOCSTI: ::c_int = 0x5412;
498+
pub const TIOCGWINSZ: ::c_int = 0x5413;
499+
pub const TIOCSWINSZ: ::c_int = 0x5414;
500+
pub const TIOCMGET: ::c_int = 0x5415;
501+
pub const TIOCMBIS: ::c_int = 0x5416;
502+
pub const TIOCMBIC: ::c_int = 0x5417;
503+
pub const TIOCMSET: ::c_int = 0x5418;
504+
pub const FIONREAD: ::c_int = 0x541B;
505+
pub const TIOCCONS: ::c_int = 0x541D;
506+
478507
f! {
479508
pub fn sigemptyset(set: *mut sigset_t) -> ::c_int {
480509
*set = 0;
@@ -510,18 +539,18 @@ f! {
510539
return 0
511540
}
512541
pub fn tcgetattr(fd: ::c_int, termios: *mut ::termios) -> ::c_int {
513-
ioctl(fd, TCGETS, termios)
542+
ioctl(fd, ::TCGETS, termios)
514543
}
515544
pub fn tcsetattr(fd: ::c_int,
516545
optional_actions: ::c_int,
517546
termios: *const ::termios) -> ::c_int {
518547
ioctl(fd, optional_actions, termios)
519548
}
520549
pub fn tcflow(fd: ::c_int, action: ::c_int) -> ::c_int {
521-
ioctl(fd, TCXONC, action as *mut ::c_void)
550+
ioctl(fd, ::TCXONC, action as *mut ::c_void)
522551
}
523552
pub fn tcflush(fd: ::c_int, action: ::c_int) -> ::c_int {
524-
ioctl(fd, TCFLSH, action as *mut ::c_void)
553+
ioctl(fd, ::TCFLSH, action as *mut ::c_void)
525554
}
526555
pub fn tcsendbreak(fd: ::c_int, duration: ::c_int) -> ::c_int {
527556
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)