Skip to content

Commit 73c0263

Browse files
committed
Auto merge of #1040 - semarie:openbsd-fix, r=alexcrichton
Openbsd fix put in several fixes for OpenBSD (one fix per commit). testsuite ran on OpenBSD 6.3-current (upcoming 6.4) ``` RUNNING ALL TESTS PASSED 6474 tests ```
2 parents bfe0e32 + fec9baf commit 73c0263

File tree

5 files changed

+26
-21
lines changed

5 files changed

+26
-21
lines changed

libc-test/build.rs

-6
Original file line numberDiff line numberDiff line change
@@ -538,12 +538,6 @@ fn main() {
538538
"KERN_USERMOUNT" |
539539
"KERN_ARND" if openbsd => true,
540540

541-
// These constants were added in OpenBSD 6.2
542-
"EV_RECEIPT" | "EV_DISPATCH" if openbsd => true,
543-
544-
// These constants were added in OpenBSD 6.3
545-
"MAP_STACK" if openbsd => true,
546-
547541
// These are either unimplemented or optionally built into uClibc
548542
"LC_CTYPE_MASK" | "LC_NUMERIC_MASK" | "LC_TIME_MASK" | "LC_COLLATE_MASK" | "LC_MONETARY_MASK" | "LC_MESSAGES_MASK" |
549543
"MADV_MERGEABLE" | "MADV_UNMERGEABLE" | "MADV_HWPOISON" | "IPV6_ADD_MEMBERSHIP" | "IPV6_DROP_MEMBERSHIP" | "IPV6_MULTICAST_LOOP" | "IPV6_V6ONLY" |

src/unix/bsd/netbsdlike/mod.rs

-13
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,6 @@ s! {
5757
pub l_type: ::c_short,
5858
pub l_whence: ::c_short,
5959
}
60-
61-
#[repr(packed)]
62-
pub struct arphdr {
63-
pub ar_hrd: u16,
64-
pub ar_pro: u16,
65-
pub ar_hln: u8,
66-
pub ar_pln: u8,
67-
pub ar_op: u16,
68-
}
6960
}
7061

7162
pub const D_T_FMT: ::nl_item = 0;
@@ -430,10 +421,6 @@ pub const IPV6_RECVPKTINFO: ::c_int = 36;
430421
pub const IPV6_PKTINFO: ::c_int = 46;
431422

432423
pub const TCP_NODELAY: ::c_int = 0x01;
433-
pub const TCP_KEEPIDLE: ::c_int = 3;
434-
pub const TCP_KEEPINTVL: ::c_int = 5;
435-
pub const TCP_KEEPCNT: ::c_int = 6;
436-
pub const TCP_KEEPINIT: ::c_int = 7;
437424

438425
pub const SOL_SOCKET: ::c_int = 0xffff;
439426
pub const SO_DEBUG: ::c_int = 0x01;

src/unix/bsd/netbsdlike/netbsd/mod.rs

+14
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,15 @@ s! {
318318
pub ipi_addr: ::in_addr,
319319
pub ipi_ifindex: ::c_uint,
320320
}
321+
322+
#[repr(packed)]
323+
pub struct arphdr {
324+
pub ar_hrd: u16,
325+
pub ar_pro: u16,
326+
pub ar_hln: u8,
327+
pub ar_pln: u8,
328+
pub ar_op: u16,
329+
}
321330
}
322331

323332
pub const AT_FDCWD: ::c_int = -100;
@@ -381,6 +390,11 @@ pub const IP_RECVPKTINFO: ::c_int = 26;
381390
pub const IPV6_JOIN_GROUP: ::c_int = 12;
382391
pub const IPV6_LEAVE_GROUP: ::c_int = 13;
383392

393+
pub const TCP_KEEPIDLE: ::c_int = 3;
394+
pub const TCP_KEEPINTVL: ::c_int = 5;
395+
pub const TCP_KEEPCNT: ::c_int = 6;
396+
pub const TCP_KEEPINIT: ::c_int = 7;
397+
384398
pub const SOCK_CONN_DGRAM: ::c_int = 6;
385399
pub const SOCK_DCCP: ::c_int = SOCK_CONN_DGRAM;
386400
pub const SOCK_NOSIGPIPE: ::c_int = 0x40000000;

src/unix/bsd/netbsdlike/openbsdlike/mod.rs

+11-1
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,14 @@ s! {
193193
pub gid: ::gid_t,
194194
pub pid: ::pid_t,
195195
}
196+
197+
pub struct arphdr {
198+
pub ar_hrd: u16,
199+
pub ar_pro: u16,
200+
pub ar_hln: u8,
201+
pub ar_pln: u8,
202+
pub ar_op: u16,
203+
}
196204
}
197205

198206
pub const UT_NAMESIZE: usize = 32;
@@ -579,6 +587,7 @@ pub const CTL_MACHDEP: ::c_int = 7;
579587
pub const CTL_DDB: ::c_int = 9;
580588
pub const CTL_VFS: ::c_int = 10;
581589
pub const CTL_MAXID: ::c_int = 11;
590+
pub const HW_NCPUONLINE: ::c_int = 25;
582591
pub const KERN_OSTYPE: ::c_int = 1;
583592
pub const KERN_OSRELEASE: ::c_int = 2;
584593
pub const KERN_OSREV: ::c_int = 3;
@@ -653,7 +662,8 @@ pub const KERN_PROC_VMMAP: ::c_int = 80;
653662
pub const KERN_GLOBAL_PTRACE: ::c_int = 81;
654663
pub const KERN_CONSBUFSIZE: ::c_int = 82;
655664
pub const KERN_CONSBUF: ::c_int = 83;
656-
pub const KERN_MAXID: ::c_int = 84;
665+
pub const KERN_AUDIO: ::c_int = 84;
666+
pub const KERN_MAXID: ::c_int = 85;
657667
pub const KERN_PROC_ALL: ::c_int = 0;
658668
pub const KERN_PROC_PID: ::c_int = 1;
659669
pub const KERN_PROC_PGRP: ::c_int = 2;

src/unix/bsd/netbsdlike/openbsdlike/openbsd/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ pub const IFF_LINK1: ::c_int = 0x2000; // per link layer defined bit
4747
pub const IFF_LINK2: ::c_int = 0x4000; // per link layer defined bit
4848
pub const IFF_MULTICAST: ::c_int = 0x8000; // supports multicast
4949

50-
pub const SIGSTKSZ : ::size_t = 24576;
50+
pub const SIGSTKSZ : ::size_t = 28672;
5151

5252
extern {
5353
pub fn accept4(s: ::c_int, addr: *mut ::sockaddr,

0 commit comments

Comments
 (0)