Skip to content

Commit 1f1ebd5

Browse files
committed
Auto merge of #2616 - nanpuyue:fix-freebsd-ttycom, r=Amanieu
fix(freebsd): incorrect constant type from ttycom.h ref: #493 the value and type of the constant are obtained by executing the following script ttycom.sh: ``` #/bin/sh cat <<EOF #include <stdio.h> #include <sys/ttycom.h> #include <sys/time.h> #include <termios.h> void main() { EOF grep -o TIOC[A-Z_]* /usr/include/sys/ttycom.h | sort -u |\ xargs -I{} echo ' printf("pub const {}: u%lu = 0x%lx;\n", sizeof({})*8, {});' echo '}' ``` ``` ./ttycom.sh > main.c clang main.c ./a.out ```
2 parents cc186d7 + d35e9ea commit 1f1ebd5

File tree

3 files changed

+27
-27
lines changed

3 files changed

+27
-27
lines changed

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -1287,11 +1287,11 @@ pub const LC_ALL_MASK: ::c_int = LC_COLLATE_MASK
12871287
| LC_NUMERIC_MASK
12881288
| LC_TIME_MASK;
12891289

1290-
pub const TIOCSIG: ::c_uint = 0x2000745f;
1290+
pub const TIOCSIG: ::c_ulong = 0x2000745f;
12911291
pub const BTUARTDISC: ::c_int = 0x7;
1292-
pub const TIOCDCDTIMESTAMP: ::c_uint = 0x40107458;
1293-
pub const TIOCISPTMASTER: ::c_uint = 0x20007455;
1294-
pub const TIOCMODG: ::c_uint = 0x40047403;
1292+
pub const TIOCDCDTIMESTAMP: ::c_ulong = 0x40107458;
1293+
pub const TIOCISPTMASTER: ::c_ulong = 0x20007455;
1294+
pub const TIOCMODG: ::c_ulong = 0x40047403;
12951295
pub const TIOCMODS: ::c_ulong = 0x80047404;
12961296
pub const TIOCREMOTE: ::c_ulong = 0x80047469;
12971297

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -2158,9 +2158,9 @@ pub const CTL_P1003_1B_SEM_VALUE_MAX: ::c_int = 23;
21582158
pub const CTL_P1003_1B_SIGQUEUE_MAX: ::c_int = 24;
21592159
pub const CTL_P1003_1B_TIMER_MAX: ::c_int = 25;
21602160

2161-
pub const TIOCGPTN: ::c_uint = 0x4004740f;
2162-
pub const TIOCPTMASTER: ::c_uint = 0x2000741c;
2163-
pub const TIOCSIG: ::c_uint = 0x2004745f;
2161+
pub const TIOCGPTN: ::c_ulong = 0x4004740f;
2162+
pub const TIOCPTMASTER: ::c_ulong = 0x2000741c;
2163+
pub const TIOCSIG: ::c_ulong = 0x2004745f;
21642164
pub const TIOCM_DCD: ::c_int = 0x40;
21652165
pub const H4DISC: ::c_int = 0x7;
21662166

src/unix/bsd/freebsdlike/mod.rs

+20-20
Original file line numberDiff line numberDiff line change
@@ -1193,30 +1193,30 @@ pub const LOG_SECURITY: ::c_int = 13 << 3;
11931193
pub const LOG_CONSOLE: ::c_int = 14 << 3;
11941194
pub const LOG_NFACILITIES: ::c_int = 24;
11951195

1196-
pub const TIOCEXCL: ::c_uint = 0x2000740d;
1197-
pub const TIOCNXCL: ::c_uint = 0x2000740e;
1196+
pub const TIOCEXCL: ::c_ulong = 0x2000740d;
1197+
pub const TIOCNXCL: ::c_ulong = 0x2000740e;
11981198
pub const TIOCFLUSH: ::c_ulong = 0x80047410;
1199-
pub const TIOCGETA: ::c_uint = 0x402c7413;
1199+
pub const TIOCGETA: ::c_ulong = 0x402c7413;
12001200
pub const TIOCSETA: ::c_ulong = 0x802c7414;
12011201
pub const TIOCSETAW: ::c_ulong = 0x802c7415;
12021202
pub const TIOCSETAF: ::c_ulong = 0x802c7416;
1203-
pub const TIOCGETD: ::c_uint = 0x4004741a;
1203+
pub const TIOCGETD: ::c_ulong = 0x4004741a;
12041204
pub const TIOCSETD: ::c_ulong = 0x8004741b;
1205-
pub const TIOCGDRAINWAIT: ::c_uint = 0x40047456;
1205+
pub const TIOCGDRAINWAIT: ::c_ulong = 0x40047456;
12061206
pub const TIOCSDRAINWAIT: ::c_ulong = 0x80047457;
1207-
pub const TIOCTIMESTAMP: ::c_uint = 0x40107459;
1208-
pub const TIOCMGDTRWAIT: ::c_uint = 0x4004745a;
1207+
pub const TIOCTIMESTAMP: ::c_ulong = 0x40107459;
1208+
pub const TIOCMGDTRWAIT: ::c_ulong = 0x4004745a;
12091209
pub const TIOCMSDTRWAIT: ::c_ulong = 0x8004745b;
1210-
pub const TIOCDRAIN: ::c_uint = 0x2000745e;
1210+
pub const TIOCDRAIN: ::c_ulong = 0x2000745e;
12111211
pub const TIOCEXT: ::c_ulong = 0x80047460;
1212-
pub const TIOCSCTTY: ::c_uint = 0x20007461;
1212+
pub const TIOCSCTTY: ::c_ulong = 0x20007461;
12131213
pub const TIOCCONS: ::c_ulong = 0x80047462;
1214-
pub const TIOCGSID: ::c_uint = 0x40047463;
1215-
pub const TIOCSTAT: ::c_uint = 0x20007465;
1214+
pub const TIOCGSID: ::c_ulong = 0x40047463;
1215+
pub const TIOCSTAT: ::c_ulong = 0x20007465;
12161216
pub const TIOCUCNTL: ::c_ulong = 0x80047466;
12171217
pub const TIOCSWINSZ: ::c_ulong = 0x80087467;
1218-
pub const TIOCGWINSZ: ::c_uint = 0x40087468;
1219-
pub const TIOCMGET: ::c_uint = 0x4004746a;
1218+
pub const TIOCGWINSZ: ::c_ulong = 0x40087468;
1219+
pub const TIOCMGET: ::c_ulong = 0x4004746a;
12201220
pub const TIOCM_LE: ::c_int = 0x1;
12211221
pub const TIOCM_DTR: ::c_int = 0x2;
12221222
pub const TIOCM_RTS: ::c_int = 0x4;
@@ -1231,8 +1231,8 @@ pub const TIOCM_RNG: ::c_int = 0x80;
12311231
pub const TIOCMBIC: ::c_ulong = 0x8004746b;
12321232
pub const TIOCMBIS: ::c_ulong = 0x8004746c;
12331233
pub const TIOCMSET: ::c_ulong = 0x8004746d;
1234-
pub const TIOCSTART: ::c_uint = 0x2000746e;
1235-
pub const TIOCSTOP: ::c_uint = 0x2000746f;
1234+
pub const TIOCSTART: ::c_ulong = 0x2000746e;
1235+
pub const TIOCSTOP: ::c_ulong = 0x2000746f;
12361236
pub const TIOCPKT: ::c_ulong = 0x80047470;
12371237
pub const TIOCPKT_DATA: ::c_int = 0x0;
12381238
pub const TIOCPKT_FLUSHREAD: ::c_int = 0x1;
@@ -1242,13 +1242,13 @@ pub const TIOCPKT_START: ::c_int = 0x8;
12421242
pub const TIOCPKT_NOSTOP: ::c_int = 0x10;
12431243
pub const TIOCPKT_DOSTOP: ::c_int = 0x20;
12441244
pub const TIOCPKT_IOCTL: ::c_int = 0x40;
1245-
pub const TIOCNOTTY: ::c_uint = 0x20007471;
1245+
pub const TIOCNOTTY: ::c_ulong = 0x20007471;
12461246
pub const TIOCSTI: ::c_ulong = 0x80017472;
1247-
pub const TIOCOUTQ: ::c_uint = 0x40047473;
1247+
pub const TIOCOUTQ: ::c_ulong = 0x40047473;
12481248
pub const TIOCSPGRP: ::c_ulong = 0x80047476;
1249-
pub const TIOCGPGRP: ::c_uint = 0x40047477;
1250-
pub const TIOCCDTR: ::c_uint = 0x20007478;
1251-
pub const TIOCSDTR: ::c_uint = 0x20007479;
1249+
pub const TIOCGPGRP: ::c_ulong = 0x40047477;
1250+
pub const TIOCCDTR: ::c_ulong = 0x20007478;
1251+
pub const TIOCSDTR: ::c_ulong = 0x20007479;
12521252
pub const TTYDISC: ::c_int = 0x0;
12531253
pub const SLIPDISC: ::c_int = 0x4;
12541254
pub const PPPDISC: ::c_int = 0x5;

0 commit comments

Comments
 (0)