Skip to content

Commit 4fe2cc2

Browse files
committed
Auto merge of rust-lang#493 - johalun:freebsd-ttycom, r=alexcrichton
Added defines from ttycom.h for dragonfly and freebsd. I wasn't sure about the convention but looking at other files it seems that whatever is over 0x80000000 is c_ulong so I went with that.
2 parents cb7f667 + 2d108fe commit 4fe2cc2

File tree

3 files changed

+68
-1
lines changed

3 files changed

+68
-1
lines changed

src/unix/bsd/freebsdlike/dragonfly/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,8 @@ pub const LC_ALL_MASK: ::c_int = LC_COLLATE_MASK
370370
| LC_NUMERIC_MASK
371371
| LC_TIME_MASK;
372372

373+
pub const TIOCSIG: ::c_uint = 0x2000745f;
374+
373375
extern {
374376
pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int)
375377
-> ::c_int;

src/unix/bsd/freebsdlike/freebsd/mod.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,11 @@ pub const CTL_P1003_1B_SEM_NSEMS_MAX: ::c_int = 22;
316316
pub const CTL_P1003_1B_SEM_VALUE_MAX: ::c_int = 23;
317317
pub const CTL_P1003_1B_SIGQUEUE_MAX: ::c_int = 24;
318318
pub const CTL_P1003_1B_TIMER_MAX: ::c_int = 25;
319+
pub const TIOCGPTN: ::c_uint = 0x4004740f;
320+
pub const TIOCPTMASTER: ::c_uint = 0x2000741c;
321+
pub const TIOCSIG: ::c_uint = 0x2004745f;
322+
pub const TIOCM_DCD: ::c_int = 0x40;
323+
pub const H4DISC: ::c_int = 0x7;
319324

320325
// The *_MAXID constants never should've been used outside of the
321326
// FreeBSD base system. And with the exception of CTL_P1003_1B_MAXID,

src/unix/bsd/freebsdlike/mod.rs

Lines changed: 61 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -688,8 +688,68 @@ pub const LOG_SECURITY: ::c_int = 13 << 3;
688688
pub const LOG_CONSOLE: ::c_int = 14 << 3;
689689
pub const LOG_NFACILITIES: ::c_int = 24;
690690

691-
pub const TIOCGWINSZ: ::c_ulong = 0x40087468;
691+
pub const TIOCEXCL: ::c_uint = 0x2000740d;
692+
pub const TIOCNXCL: ::c_uint = 0x2000740e;
693+
pub const TIOCFLUSH: ::c_ulong = 0x80047410;
694+
pub const TIOCGETA: ::c_uint = 0x402c7413;
695+
pub const TIOCSETA: ::c_ulong = 0x802c7414;
696+
pub const TIOCSETAW: ::c_ulong = 0x802c7415;
697+
pub const TIOCSETAF: ::c_ulong = 0x802c7416;
698+
pub const TIOCGETD: ::c_uint = 0x4004741a;
699+
pub const TIOCSETD: ::c_ulong = 0x8004741b;
700+
pub const TIOCGDRAINWAIT: ::c_uint = 0x40047456;
701+
pub const TIOCSDRAINWAIT: ::c_ulong = 0x80047457;
702+
pub const TIOCTIMESTAMP: ::c_uint = 0x40107459;
703+
pub const TIOCMGDTRWAIT: ::c_uint = 0x4004745a;
704+
pub const TIOCMSDTRWAIT: ::c_ulong = 0x8004745b;
705+
pub const TIOCDRAIN: ::c_uint = 0x2000745e;
706+
pub const TIOCEXT: ::c_ulong = 0x80047460;
707+
pub const TIOCSCTTY: ::c_uint = 0x20007461;
708+
pub const TIOCCONS: ::c_ulong = 0x80047462;
709+
pub const TIOCGSID: ::c_uint = 0x40047463;
710+
pub const TIOCSTAT: ::c_uint = 0x20007465;
711+
pub const TIOCUCNTL: ::c_ulong = 0x80047466;
692712
pub const TIOCSWINSZ: ::c_ulong = 0x80087467;
713+
pub const TIOCGWINSZ: ::c_uint = 0x40087468;
714+
pub const TIOCMGET: ::c_uint = 0x4004746a;
715+
pub const TIOCM_LE: ::c_int = 0x1;
716+
pub const TIOCM_DTR: ::c_int = 0x2;
717+
pub const TIOCM_RTS: ::c_int = 0x4;
718+
pub const TIOCM_ST: ::c_int = 0x8;
719+
pub const TIOCM_SR: ::c_int = 0x10;
720+
pub const TIOCM_CTS: ::c_int = 0x20;
721+
pub const TIOCM_RI: ::c_int = 0x80;
722+
pub const TIOCM_DSR: ::c_int = 0x100;
723+
pub const TIOCM_CD: ::c_int = 0x40;
724+
pub const TIOCM_CAR: ::c_int = 0x40;
725+
pub const TIOCM_RNG: ::c_int = 0x80;
726+
pub const TIOCMBIC: ::c_ulong = 0x8004746b;
727+
pub const TIOCMBIS: ::c_ulong = 0x8004746c;
728+
pub const TIOCMSET: ::c_ulong = 0x8004746d;
729+
pub const TIOCSTART: ::c_uint = 0x2000746e;
730+
pub const TIOCSTOP: ::c_uint = 0x2000746f;
731+
pub const TIOCPKT: ::c_ulong = 0x80047470;
732+
pub const TIOCPKT_DATA: ::c_int = 0x0;
733+
pub const TIOCPKT_FLUSHREAD: ::c_int = 0x1;
734+
pub const TIOCPKT_FLUSHWRITE: ::c_int = 0x2;
735+
pub const TIOCPKT_STOP: ::c_int = 0x4;
736+
pub const TIOCPKT_START: ::c_int = 0x8;
737+
pub const TIOCPKT_NOSTOP: ::c_int = 0x10;
738+
pub const TIOCPKT_DOSTOP: ::c_int = 0x20;
739+
pub const TIOCPKT_IOCTL: ::c_int = 0x40;
740+
pub const TIOCNOTTY: ::c_uint = 0x20007471;
741+
pub const TIOCSTI: ::c_ulong = 0x80017472;
742+
pub const TIOCOUTQ: ::c_uint = 0x40047473;
743+
pub const TIOCSPGRP: ::c_ulong = 0x80047476;
744+
pub const TIOCGPGRP: ::c_uint = 0x40047477;
745+
pub const TIOCCDTR: ::c_uint = 0x20007478;
746+
pub const TIOCSDTR: ::c_uint = 0x20007479;
747+
pub const TIOCCBRK: ::c_uint = 0x2000747a;
748+
pub const TIOCSBRK: ::c_uint = 0x2000747b;
749+
pub const TTYDISC: ::c_int = 0x0;
750+
pub const SLIPDISC: ::c_int = 0x4;
751+
pub const PPPDISC: ::c_int = 0x5;
752+
pub const NETGRAPHDISC: ::c_int = 0x6;
693753

694754
pub const SEM_FAILED: *mut sem_t = 0 as *mut sem_t;
695755

0 commit comments

Comments
 (0)