Skip to content

Commit bebfcd7

Browse files
committed
Remove removed items in OpenBSD
1 parent 8a846aa commit bebfcd7

File tree

6 files changed

+10
-42
lines changed

6 files changed

+10
-42
lines changed

libc-test/build.rs

-18
Original file line numberDiff line numberDiff line change
@@ -523,13 +523,6 @@ fn test_openbsd(target: &str) {
523523

524524
cfg.skip_const(move |name| {
525525
match name {
526-
// Removed in OpenBSD 6.0
527-
"KERN_USERMOUNT" | "KERN_ARND" => true,
528-
// Removed in OpenBSD 7.2
529-
"KERN_NSELCOLL" => true,
530-
// Good chance it's going to be wrong depending on the host release
531-
"KERN_MAXID" | "NET_RT_MAXID" => true,
532-
"EV_SYSFLAGS" => true,
533526
_ => false,
534527
}
535528
});
@@ -539,20 +532,9 @@ fn test_openbsd(target: &str) {
539532
// FIXME: https://github.com/rust-lang/libc/issues/1272
540533
"execv" | "execve" | "execvp" | "execvpe" => true,
541534

542-
// Removed in OpenBSD 6.5
543-
// https://marc.info/?l=openbsd-cvs&m=154723400730318
544-
"mincore" => true,
545-
546535
// futex() has volatile arguments, but that doesn't exist in Rust.
547536
"futex" => true,
548537

549-
// Available for openBSD 7.3
550-
"mimmutable" => true,
551-
552-
// Removed in OpenBSD 7.5
553-
// https://marc.info/?l=openbsd-cvs&m=170239504300386
554-
"syscall" => true,
555-
556538
_ => false,
557539
}
558540
});

libc-test/semver/openbsd.txt

-6
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,6 @@ ITIMER_PROF
331331
ITIMER_REAL
332332
ITIMER_VIRTUAL
333333
KERN_ARGMAX
334-
KERN_ARND
335334
KERN_AUDIO
336335
KERN_BOOTTIME
337336
KERN_CACHEPCT
@@ -357,7 +356,6 @@ KERN_JOB_CONTROL
357356
KERN_MALLOCSTATS
358357
KERN_MAXCLUSTERS
359358
KERN_MAXFILES
360-
KERN_MAXID
361359
KERN_MAXLOCKSPERUID
362360
KERN_MAXPARTITIONS
363361
KERN_MAXPROC
@@ -372,7 +370,6 @@ KERN_NFILES
372370
KERN_NGROUPS
373371
KERN_NOSUIDCOREDUMP
374372
KERN_NPROCS
375-
KERN_NSELCOLL
376373
KERN_NTHREADS
377374
KERN_NUMVNODES
378375
KERN_OSRELEASE
@@ -422,7 +419,6 @@ KERN_TIMECOUNTER
422419
KERN_TIMEOUT_STATS
423420
KERN_TTY
424421
KERN_TTYCOUNT
425-
KERN_USERMOUNT
426422
KERN_VERSION
427423
KERN_WATCHDOG
428424
KVE_ADV_NORMAL
@@ -1129,7 +1125,6 @@ memmem
11291125
memrchr
11301126
mfs_args
11311127
mimmutable
1132-
mincore
11331128
mkdirat
11341129
mkfifoat
11351130
mknodat
@@ -1279,7 +1274,6 @@ strndup
12791274
strsignal
12801275
strtonum
12811276
sync
1282-
syscall
12831277
sysctl
12841278
tcp_info
12851279
telldir

src/unix/bsd/mod.rs

+8-1
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,6 @@ extern "C" {
632632
pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int;
633633
pub fn kqueue() -> ::c_int;
634634
pub fn unmount(target: *const ::c_char, arg: ::c_int) -> ::c_int;
635-
pub fn syscall(num: ::c_int, ...) -> ::c_int;
636635
#[cfg_attr(target_os = "netbsd", link_name = "__getpwent50")]
637636
pub fn getpwent() -> *mut passwd;
638637
pub fn setpwent();
@@ -916,6 +915,14 @@ extern "C" {
916915
) -> ::size_t;
917916
}
918917

918+
cfg_if! {
919+
if #[cfg(not(target_os = "openbsd"))] {
920+
extern "C" {
921+
pub fn syscall(num: ::c_int, ...) -> ::c_int;
922+
}
923+
}
924+
}
925+
919926
cfg_if! {
920927
if #[cfg(any(target_os = "macos", target_os = "ios", target_os = "tvos", target_os = "watchos"))] {
921928
mod apple;

src/unix/bsd/netbsdlike/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,6 @@ extern "C" {
672672
addrlen: *mut ::socklen_t,
673673
flags: ::c_int,
674674
) -> ::c_int;
675-
pub fn mincore(addr: *mut ::c_void, len: ::size_t, vec: *mut ::c_char) -> ::c_int;
676675
#[cfg_attr(target_os = "netbsd", link_name = "__clock_getres50")]
677676
pub fn clock_getres(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
678677
#[cfg_attr(target_os = "netbsd", link_name = "__clock_gettime50")]

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

+2
Original file line numberDiff line numberDiff line change
@@ -2902,6 +2902,8 @@ extern "C" {
29022902
result: *mut *mut ::group,
29032903
) -> ::c_int;
29042904

2905+
pub fn mincore(addr: *mut ::c_void, len: ::size_t, vec: *mut ::c_char) -> ::c_int;
2906+
29052907
pub fn updwtmpx(file: *const ::c_char, ut: *const utmpx) -> ::c_int;
29062908
pub fn getlastlogx(fname: *const ::c_char, uid: ::uid_t, ll: *mut lastlogx) -> *mut lastlogx;
29072909
pub fn updlastlogx(fname: *const ::c_char, uid: ::uid_t, ll: *mut lastlogx) -> ::c_int;

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

-16
Original file line numberDiff line numberDiff line change
@@ -1248,12 +1248,6 @@ pub const NET_RT_IFLIST: ::c_int = 3;
12481248
pub const NET_RT_STATS: ::c_int = 4;
12491249
pub const NET_RT_TABLE: ::c_int = 5;
12501250
pub const NET_RT_IFNAMES: ::c_int = 6;
1251-
#[doc(hidden)]
1252-
#[deprecated(
1253-
since = "0.2.95",
1254-
note = "Possibly increasing over the releases and might not be so used in the field"
1255-
)]
1256-
pub const NET_RT_MAXID: ::c_int = 7;
12571251

12581252
pub const IPV6_JOIN_GROUP: ::c_int = 12;
12591253
pub const IPV6_LEAVE_GROUP: ::c_int = 13;
@@ -1554,21 +1548,16 @@ pub const KERN_NTHREADS: ::c_int = 26;
15541548
pub const KERN_OSVERSION: ::c_int = 27;
15551549
pub const KERN_SOMAXCONN: ::c_int = 28;
15561550
pub const KERN_SOMINCONN: ::c_int = 29;
1557-
#[deprecated(since = "0.2.71", note = "Removed in OpenBSD 6.0")]
1558-
pub const KERN_USERMOUNT: ::c_int = 30;
15591551
pub const KERN_NOSUIDCOREDUMP: ::c_int = 32;
15601552
pub const KERN_FSYNC: ::c_int = 33;
15611553
pub const KERN_SYSVMSG: ::c_int = 34;
15621554
pub const KERN_SYSVSEM: ::c_int = 35;
15631555
pub const KERN_SYSVSHM: ::c_int = 36;
1564-
#[deprecated(since = "0.2.71", note = "Removed in OpenBSD 6.0")]
1565-
pub const KERN_ARND: ::c_int = 37;
15661556
pub const KERN_MSGBUFSIZE: ::c_int = 38;
15671557
pub const KERN_MALLOCSTATS: ::c_int = 39;
15681558
pub const KERN_CPTIME: ::c_int = 40;
15691559
pub const KERN_NCHSTATS: ::c_int = 41;
15701560
pub const KERN_FORKSTAT: ::c_int = 42;
1571-
pub const KERN_NSELCOLL: ::c_int = 43;
15721561
pub const KERN_TTY: ::c_int = 44;
15731562
pub const KERN_CCPU: ::c_int = 45;
15741563
pub const KERN_FSCALE: ::c_int = 46;
@@ -1608,11 +1597,6 @@ pub const KERN_AUDIO: ::c_int = 84;
16081597
pub const KERN_CPUSTATS: ::c_int = 85;
16091598
pub const KERN_PFSTATUS: ::c_int = 86;
16101599
pub const KERN_TIMEOUT_STATS: ::c_int = 87;
1611-
#[deprecated(
1612-
since = "0.2.95",
1613-
note = "Possibly increasing over the releases and might not be so used in the field"
1614-
)]
1615-
pub const KERN_MAXID: ::c_int = 88;
16161600

16171601
pub const KERN_PROC_ALL: ::c_int = 0;
16181602
pub const KERN_PROC_PID: ::c_int = 1;

0 commit comments

Comments
 (0)