Skip to content

Commit 4eb4be4

Browse files
committed
Auto merge of #530 - berkowski:baud_constants, r=alexcrichton
Added baudrate constants. Addresses #528, adding baudrate constants for `bsd` and `notbsd` flavors of `unix`. Passes `libc-test` locally on ubuntu 14.04 LTS with the additional (uncommitted) entries into in `build.rs`: ``` cfg.skip_const( move |name| { match name { # ... snip ... "PTRACE_O_SUSPEND_SECCOMP" | "CLONE_NEWCGROUP" | "NETLINK_LIST_MEMBERSHIPS" | "NETLINK_LISTEN_ALL_NSID" | "NETLINK_CAP_ACK" | "PR_CAP_AMBIENT_CLEAR_ALL" | "PR_CAP_AMBIENT_LOWER" | "PR_CAP_AMBIENT_RAISE" | "PR_CAP_AMBIENT_IS_SET" | "PR_CAP_AMBIENT" | "PR_FP_MODE_FRE" | "PR_FP_MODE_FR" | "PR_GET_FP_MODE" | "PR_SET_FP_MODE" | "PR_MPX_DISABLE_MANAGEMENT" | "PR_MPX_ENABLE_MANAGEMENT" | "PR_GET_THP_DISABLE" | "PR_SET_THP_DISABLE" | "PR_SET_MM_MAP_SIZE" | "PR_GET_MM_MAP_SIZE" | "PR_SET_MM_MAP" | "NLM_F_DUMP_FILTERED" | "EPOLLEXCLUSIVE" => true, _ => false, } }); ``` I'm assuming this is because I'm stuck using `linux-libc-dev:3.13.0-24.46` for the moment and those constants are defined in newer versions.
2 parents 64d954c + fb11c7a commit 4eb4be4

File tree

13 files changed

+389
-0
lines changed

13 files changed

+389
-0
lines changed

libc-test/build.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ fn main() {
207207
if openbsd {
208208
cfg.header("ufs/ufs/quota.h");
209209
cfg.header("rpcsvc/rex.h");
210+
cfg.header("termios.h");
210211
cfg.header("pthread_np.h");
211212
cfg.header("sys/syscall.h");
212213
}

src/unix/bsd/apple/mod.rs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -731,6 +731,32 @@ pub const TIOCPTYGRANT: ::c_uint = 0x20007454;
731731
pub const TIOCPTYGNAME: ::c_uint = 0x40807453;
732732
pub const TIOCPTYUNLK: ::c_uint = 0x20007452;
733733

734+
pub const B0: speed_t = 0;
735+
pub const B50: speed_t = 50;
736+
pub const B75: speed_t = 75;
737+
pub const B110: speed_t = 110;
738+
pub const B134: speed_t = 134;
739+
pub const B150: speed_t = 150;
740+
pub const B200: speed_t = 200;
741+
pub const B300: speed_t = 300;
742+
pub const B600: speed_t = 600;
743+
pub const B1200: speed_t = 1200;
744+
pub const B1800: speed_t = 1800;
745+
pub const B2400: speed_t = 2400;
746+
pub const B4800: speed_t = 4800;
747+
pub const B9600: speed_t = 9600;
748+
pub const B19200: speed_t = 19200;
749+
pub const B38400: speed_t = 38400;
750+
pub const B7200: speed_t = 7200;
751+
pub const B14400: speed_t = 14400;
752+
pub const B28800: speed_t = 28800;
753+
pub const B57600: speed_t = 57600;
754+
pub const B76800: speed_t = 76800;
755+
pub const B115200: speed_t = 115200;
756+
pub const B230400: speed_t = 230400;
757+
pub const EXTA: speed_t = 19200;
758+
pub const EXTB: speed_t = 38400;
759+
734760
pub const SIGTRAP: ::c_int = 5;
735761

736762
pub const GLOB_APPEND : ::c_int = 0x0001;

src/unix/bsd/freebsdlike/mod.rs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -753,6 +753,34 @@ pub const SLIPDISC: ::c_int = 0x4;
753753
pub const PPPDISC: ::c_int = 0x5;
754754
pub const NETGRAPHDISC: ::c_int = 0x6;
755755

756+
pub const B0: speed_t = 0;
757+
pub const B50: speed_t = 50;
758+
pub const B75: speed_t = 75;
759+
pub const B110: speed_t = 110;
760+
pub const B134: speed_t = 134;
761+
pub const B150: speed_t = 150;
762+
pub const B200: speed_t = 200;
763+
pub const B300: speed_t = 300;
764+
pub const B600: speed_t = 600;
765+
pub const B1200: speed_t = 1200;
766+
pub const B1800: speed_t = 1800;
767+
pub const B2400: speed_t = 2400;
768+
pub const B4800: speed_t = 4800;
769+
pub const B9600: speed_t = 9600;
770+
pub const B19200: speed_t = 19200;
771+
pub const B38400: speed_t = 38400;
772+
pub const B7200: speed_t = 7200;
773+
pub const B14400: speed_t = 14400;
774+
pub const B28800: speed_t = 28800;
775+
pub const B57600: speed_t = 57600;
776+
pub const B76800: speed_t = 76800;
777+
pub const B115200: speed_t = 115200;
778+
pub const B230400: speed_t = 230400;
779+
pub const B460800: speed_t = 460800;
780+
pub const B921600: speed_t = 921600;
781+
pub const EXTA: speed_t = 19200;
782+
pub const EXTB: speed_t = 38400;
783+
756784
pub const SEM_FAILED: *mut sem_t = 0 as *mut sem_t;
757785

758786
f! {

src/unix/bsd/netbsdlike/mod.rs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,32 @@ pub const LOG_NFACILITIES: ::c_int = 24;
451451

452452
pub const HW_NCPU: ::c_int = 3;
453453

454+
pub const B0: speed_t = 0;
455+
pub const B50: speed_t = 50;
456+
pub const B75: speed_t = 75;
457+
pub const B110: speed_t = 110;
458+
pub const B134: speed_t = 134;
459+
pub const B150: speed_t = 150;
460+
pub const B200: speed_t = 200;
461+
pub const B300: speed_t = 300;
462+
pub const B600: speed_t = 600;
463+
pub const B1200: speed_t = 1200;
464+
pub const B1800: speed_t = 1800;
465+
pub const B2400: speed_t = 2400;
466+
pub const B4800: speed_t = 4800;
467+
pub const B9600: speed_t = 9600;
468+
pub const B19200: speed_t = 19200;
469+
pub const B38400: speed_t = 38400;
470+
pub const B7200: speed_t = 7200;
471+
pub const B14400: speed_t = 14400;
472+
pub const B28800: speed_t = 28800;
473+
pub const B57600: speed_t = 57600;
474+
pub const B76800: speed_t = 76800;
475+
pub const B115200: speed_t = 115200;
476+
pub const B230400: speed_t = 230400;
477+
pub const EXTA: speed_t = 19200;
478+
pub const EXTB: speed_t = 38400;
479+
454480
pub const SEM_FAILED: *mut sem_t = 0 as *mut sem_t;
455481

456482
f! {

src/unix/notbsd/android/mod.rs

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -615,6 +615,40 @@ pub const ICANON: ::tcflag_t = 0x00000002;
615615
pub const PENDIN: ::tcflag_t = 0x00004000;
616616
pub const NOFLSH: ::tcflag_t = 0x00000080;
617617

618+
pub const B0: ::speed_t = 0o000000;
619+
pub const B50: ::speed_t = 0o000001;
620+
pub const B75: ::speed_t = 0o000002;
621+
pub const B110: ::speed_t = 0o000003;
622+
pub const B134: ::speed_t = 0o000004;
623+
pub const B150: ::speed_t = 0o000005;
624+
pub const B200: ::speed_t = 0o000006;
625+
pub const B300: ::speed_t = 0o000007;
626+
pub const B600: ::speed_t = 0o000010;
627+
pub const B1200: ::speed_t = 0o000011;
628+
pub const B1800: ::speed_t = 0o000012;
629+
pub const B2400: ::speed_t = 0o000013;
630+
pub const B4800: ::speed_t = 0o000014;
631+
pub const B9600: ::speed_t = 0o000015;
632+
pub const B19200: ::speed_t = 0o000016;
633+
pub const B38400: ::speed_t = 0o000017;
634+
pub const EXTA: ::speed_t = B19200;
635+
pub const EXTB: ::speed_t = B38400;
636+
pub const B57600: ::speed_t = 0o010001;
637+
pub const B115200: ::speed_t = 0o010002;
638+
pub const B230400: ::speed_t = 0o010003;
639+
pub const B460800: ::speed_t = 0o010004;
640+
pub const B500000: ::speed_t = 0o010005;
641+
pub const B576000: ::speed_t = 0o010006;
642+
pub const B921600: ::speed_t = 0o010007;
643+
pub const B1000000: ::speed_t = 0o010010;
644+
pub const B1152000: ::speed_t = 0o010011;
645+
pub const B1500000: ::speed_t = 0o010012;
646+
pub const B2000000: ::speed_t = 0o010013;
647+
pub const B2500000: ::speed_t = 0o010014;
648+
pub const B3000000: ::speed_t = 0o010015;
649+
pub const B3500000: ::speed_t = 0o010016;
650+
pub const B4000000: ::speed_t = 0o010017;
651+
618652
pub const EAI_SYSTEM: ::c_int = 11;
619653

620654
pub const NETLINK_ROUTE: ::c_int = 0;

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

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,40 @@ pub const ICANON: ::tcflag_t = 0x00000002;
421421
pub const PENDIN: ::tcflag_t = 0x00004000;
422422
pub const NOFLSH: ::tcflag_t = 0x00000080;
423423

424+
pub const B0: ::speed_t = 0o000000;
425+
pub const B50: ::speed_t = 0o000001;
426+
pub const B75: ::speed_t = 0o000002;
427+
pub const B110: ::speed_t = 0o000003;
428+
pub const B134: ::speed_t = 0o000004;
429+
pub const B150: ::speed_t = 0o000005;
430+
pub const B200: ::speed_t = 0o000006;
431+
pub const B300: ::speed_t = 0o000007;
432+
pub const B600: ::speed_t = 0o000010;
433+
pub const B1200: ::speed_t = 0o000011;
434+
pub const B1800: ::speed_t = 0o000012;
435+
pub const B2400: ::speed_t = 0o000013;
436+
pub const B4800: ::speed_t = 0o000014;
437+
pub const B9600: ::speed_t = 0o000015;
438+
pub const B19200: ::speed_t = 0o000016;
439+
pub const B38400: ::speed_t = 0o000017;
440+
pub const EXTA: ::speed_t = B19200;
441+
pub const EXTB: ::speed_t = B38400;
442+
pub const B57600: ::speed_t = 0o010001;
443+
pub const B115200: ::speed_t = 0o010002;
444+
pub const B230400: ::speed_t = 0o010003;
445+
pub const B460800: ::speed_t = 0o010004;
446+
pub const B500000: ::speed_t = 0o010005;
447+
pub const B576000: ::speed_t = 0o010006;
448+
pub const B921600: ::speed_t = 0o010007;
449+
pub const B1000000: ::speed_t = 0o010010;
450+
pub const B1152000: ::speed_t = 0o010011;
451+
pub const B1500000: ::speed_t = 0o010012;
452+
pub const B2000000: ::speed_t = 0o010013;
453+
pub const B2500000: ::speed_t = 0o010014;
454+
pub const B3000000: ::speed_t = 0o010015;
455+
pub const B3500000: ::speed_t = 0o010016;
456+
pub const B4000000: ::speed_t = 0o010017;
457+
424458
cfg_if! {
425459
if #[cfg(target_arch = "mips")] {
426460
mod mips32;

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

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,40 @@ pub const ICANON: ::tcflag_t = 0x00000002;
277277
pub const PENDIN: ::tcflag_t = 0x00004000;
278278
pub const NOFLSH: ::tcflag_t = 0x00000080;
279279

280+
pub const B0: ::speed_t = 0o000000;
281+
pub const B50: ::speed_t = 0o000001;
282+
pub const B75: ::speed_t = 0o000002;
283+
pub const B110: ::speed_t = 0o000003;
284+
pub const B134: ::speed_t = 0o000004;
285+
pub const B150: ::speed_t = 0o000005;
286+
pub const B200: ::speed_t = 0o000006;
287+
pub const B300: ::speed_t = 0o000007;
288+
pub const B600: ::speed_t = 0o000010;
289+
pub const B1200: ::speed_t = 0o000011;
290+
pub const B1800: ::speed_t = 0o000012;
291+
pub const B2400: ::speed_t = 0o000013;
292+
pub const B4800: ::speed_t = 0o000014;
293+
pub const B9600: ::speed_t = 0o000015;
294+
pub const B19200: ::speed_t = 0o000016;
295+
pub const B38400: ::speed_t = 0o000017;
296+
pub const EXTA: ::speed_t = B19200;
297+
pub const EXTB: ::speed_t = B38400;
298+
pub const B57600: ::speed_t = 0o010001;
299+
pub const B115200: ::speed_t = 0o010002;
300+
pub const B230400: ::speed_t = 0o010003;
301+
pub const B460800: ::speed_t = 0o010004;
302+
pub const B500000: ::speed_t = 0o010005;
303+
pub const B576000: ::speed_t = 0o010006;
304+
pub const B921600: ::speed_t = 0o010007;
305+
pub const B1000000: ::speed_t = 0o010010;
306+
pub const B1152000: ::speed_t = 0o010011;
307+
pub const B1500000: ::speed_t = 0o010012;
308+
pub const B2000000: ::speed_t = 0o010013;
309+
pub const B2500000: ::speed_t = 0o010014;
310+
pub const B3000000: ::speed_t = 0o010015;
311+
pub const B3500000: ::speed_t = 0o010016;
312+
pub const B4000000: ::speed_t = 0o010017;
313+
280314
extern {
281315
pub fn ioctl(fd: ::c_int, request: ::c_int, ...) -> ::c_int;
282316
pub fn ptrace(request: ::c_int, ...) -> ::c_long;

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

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,40 @@ pub const ICANON: ::tcflag_t = 0x00000002;
141141
pub const PENDIN: ::tcflag_t = 0x00004000;
142142
pub const NOFLSH: ::tcflag_t = 0x00000080;
143143

144+
pub const B0: ::speed_t = 0o000000;
145+
pub const B50: ::speed_t = 0o000001;
146+
pub const B75: ::speed_t = 0o000002;
147+
pub const B110: ::speed_t = 0o000003;
148+
pub const B134: ::speed_t = 0o000004;
149+
pub const B150: ::speed_t = 0o000005;
150+
pub const B200: ::speed_t = 0o000006;
151+
pub const B300: ::speed_t = 0o000007;
152+
pub const B600: ::speed_t = 0o000010;
153+
pub const B1200: ::speed_t = 0o000011;
154+
pub const B1800: ::speed_t = 0o000012;
155+
pub const B2400: ::speed_t = 0o000013;
156+
pub const B4800: ::speed_t = 0o000014;
157+
pub const B9600: ::speed_t = 0o000015;
158+
pub const B19200: ::speed_t = 0o000016;
159+
pub const B38400: ::speed_t = 0o000017;
160+
pub const EXTA: ::speed_t = B19200;
161+
pub const EXTB: ::speed_t = B38400;
162+
pub const B57600: ::speed_t = 0o010001;
163+
pub const B115200: ::speed_t = 0o010002;
164+
pub const B230400: ::speed_t = 0o010003;
165+
pub const B460800: ::speed_t = 0o010004;
166+
pub const B500000: ::speed_t = 0o010005;
167+
pub const B576000: ::speed_t = 0o010006;
168+
pub const B921600: ::speed_t = 0o010007;
169+
pub const B1000000: ::speed_t = 0o010010;
170+
pub const B1152000: ::speed_t = 0o010011;
171+
pub const B1500000: ::speed_t = 0o010012;
172+
pub const B2000000: ::speed_t = 0o010013;
173+
pub const B2500000: ::speed_t = 0o010014;
174+
pub const B3000000: ::speed_t = 0o010015;
175+
pub const B3500000: ::speed_t = 0o010016;
176+
pub const B4000000: ::speed_t = 0o010017;
177+
144178
pub const VEOL: usize = 11;
145179
pub const VEOL2: usize = 16;
146180
pub const VMIN: usize = 6;

src/unix/notbsd/linux/other/b32/powerpc.rs

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,41 @@ pub const ICANON: ::tcflag_t = 0x100;
138138
pub const PENDIN: ::tcflag_t = 0x20000000;
139139
pub const NOFLSH: ::tcflag_t = 0x80000000;
140140

141+
pub const B0: ::speed_t = 0o000000;
142+
pub const B50: ::speed_t = 0o000001;
143+
pub const B75: ::speed_t = 0o000002;
144+
pub const B110: ::speed_t = 0o000003;
145+
pub const B134: ::speed_t = 0o000004;
146+
pub const B150: ::speed_t = 0o000005;
147+
pub const B200: ::speed_t = 0o000006;
148+
pub const B300: ::speed_t = 0o000007;
149+
pub const B600: ::speed_t = 0o000010;
150+
pub const B1200: ::speed_t = 0o000011;
151+
pub const B1800: ::speed_t = 0o000012;
152+
pub const B2400: ::speed_t = 0o000013;
153+
pub const B4800: ::speed_t = 0o000014;
154+
pub const B9600: ::speed_t = 0o000015;
155+
pub const B19200: ::speed_t = 0o000016;
156+
pub const B38400: ::speed_t = 0o000017;
157+
pub const EXTA: ::speed_t = B19200;
158+
pub const EXTB: ::speed_t = B38400;
159+
pub const CBAUDEX: ::speed_t = 0o000000;
160+
pub const B57600: ::speed_t = 0o0020;
161+
pub const B115200: ::speed_t = 0o0021;
162+
pub const B230400: ::speed_t = 0o0022;
163+
pub const B460800: ::speed_t = 0o0023;
164+
pub const B500000: ::speed_t = 0o0024;
165+
pub const B576000: ::speed_t = 0o0025;
166+
pub const B921600: ::speed_t = 0o0026;
167+
pub const B1000000: ::speed_t = 0o0027;
168+
pub const B1152000: ::speed_t = 0o0030;
169+
pub const B1500000: ::speed_t = 0o0031;
170+
pub const B2000000: ::speed_t = 0o0032;
171+
pub const B2500000: ::speed_t = 0o0033;
172+
pub const B3000000: ::speed_t = 0o0034;
173+
pub const B3500000: ::speed_t = 0o0035;
174+
pub const B4000000: ::speed_t = 0o0036;
175+
141176
pub const VEOL: usize = 6;
142177
pub const VEOL2: usize = 8;
143178
pub const VMIN: usize = 5;

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

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,40 @@ pub const ICANON: ::tcflag_t = 0x00000002;
176176
pub const PENDIN: ::tcflag_t = 0x00004000;
177177
pub const NOFLSH: ::tcflag_t = 0x00000080;
178178

179+
pub const B0: ::speed_t = 0o000000;
180+
pub const B50: ::speed_t = 0o000001;
181+
pub const B75: ::speed_t = 0o000002;
182+
pub const B110: ::speed_t = 0o000003;
183+
pub const B134: ::speed_t = 0o000004;
184+
pub const B150: ::speed_t = 0o000005;
185+
pub const B200: ::speed_t = 0o000006;
186+
pub const B300: ::speed_t = 0o000007;
187+
pub const B600: ::speed_t = 0o000010;
188+
pub const B1200: ::speed_t = 0o000011;
189+
pub const B1800: ::speed_t = 0o000012;
190+
pub const B2400: ::speed_t = 0o000013;
191+
pub const B4800: ::speed_t = 0o000014;
192+
pub const B9600: ::speed_t = 0o000015;
193+
pub const B19200: ::speed_t = 0o000016;
194+
pub const B38400: ::speed_t = 0o000017;
195+
pub const EXTA: ::speed_t = B19200;
196+
pub const EXTB: ::speed_t = B38400;
197+
pub const B57600: ::speed_t = 0o010001;
198+
pub const B115200: ::speed_t = 0o010002;
199+
pub const B230400: ::speed_t = 0o010003;
200+
pub const B460800: ::speed_t = 0o010004;
201+
pub const B500000: ::speed_t = 0o010005;
202+
pub const B576000: ::speed_t = 0o010006;
203+
pub const B921600: ::speed_t = 0o010007;
204+
pub const B1000000: ::speed_t = 0o010010;
205+
pub const B1152000: ::speed_t = 0o010011;
206+
pub const B1500000: ::speed_t = 0o010012;
207+
pub const B2000000: ::speed_t = 0o010013;
208+
pub const B2500000: ::speed_t = 0o010014;
209+
pub const B3000000: ::speed_t = 0o010015;
210+
pub const B3500000: ::speed_t = 0o010016;
211+
pub const B4000000: ::speed_t = 0o010017;
212+
179213
pub const VEOL: usize = 11;
180214
pub const VEOL2: usize = 16;
181215
pub const VMIN: usize = 6;

src/unix/notbsd/linux/other/b64/aarch64.rs

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,40 @@ pub const ICANON: ::tcflag_t = 0x00000002;
348348
pub const PENDIN: ::tcflag_t = 0x00004000;
349349
pub const NOFLSH: ::tcflag_t = 0x00000080;
350350

351+
pub const B0: ::speed_t = 0o000000;
352+
pub const B50: ::speed_t = 0o000001;
353+
pub const B75: ::speed_t = 0o000002;
354+
pub const B110: ::speed_t = 0o000003;
355+
pub const B134: ::speed_t = 0o000004;
356+
pub const B150: ::speed_t = 0o000005;
357+
pub const B200: ::speed_t = 0o000006;
358+
pub const B300: ::speed_t = 0o000007;
359+
pub const B600: ::speed_t = 0o000010;
360+
pub const B1200: ::speed_t = 0o000011;
361+
pub const B1800: ::speed_t = 0o000012;
362+
pub const B2400: ::speed_t = 0o000013;
363+
pub const B4800: ::speed_t = 0o000014;
364+
pub const B9600: ::speed_t = 0o000015;
365+
pub const B19200: ::speed_t = 0o000016;
366+
pub const B38400: ::speed_t = 0o000017;
367+
pub const EXTA: ::speed_t = B19200;
368+
pub const EXTB: ::speed_t = B38400;
369+
pub const B57600: ::speed_t = 0o010001;
370+
pub const B115200: ::speed_t = 0o010002;
371+
pub const B230400: ::speed_t = 0o010003;
372+
pub const B460800: ::speed_t = 0o010004;
373+
pub const B500000: ::speed_t = 0o010005;
374+
pub const B576000: ::speed_t = 0o010006;
375+
pub const B921600: ::speed_t = 0o010007;
376+
pub const B1000000: ::speed_t = 0o010010;
377+
pub const B1152000: ::speed_t = 0o010011;
378+
pub const B1500000: ::speed_t = 0o010012;
379+
pub const B2000000: ::speed_t = 0o010013;
380+
pub const B2500000: ::speed_t = 0o010014;
381+
pub const B3000000: ::speed_t = 0o010015;
382+
pub const B3500000: ::speed_t = 0o010016;
383+
pub const B4000000: ::speed_t = 0o010017;
384+
351385
pub const VEOL: usize = 11;
352386
pub const VEOL2: usize = 16;
353387
pub const VMIN: usize = 6;

0 commit comments

Comments
 (0)