Skip to content

Commit 155c38c

Browse files
devnexentgross35
authored andcommitted
freebsd kcmp call support.
(backport <rust-lang#3746>) (cherry picked from commit 68ebe1d)
1 parent e582397 commit 155c38c

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed

libc-test/build.rs

+10
Original file line numberDiff line numberDiff line change
@@ -2596,6 +2596,13 @@ fn test_freebsd(target: &str) {
25962596
true
25972597
}
25982598

2599+
// Added in FreeBSD 14.1
2600+
"KCMP_FILE" | "KCMP_FILEOBJ" | "KCMP_FILES" | "KCMP_SIGHAND" | "KCMP_VM"
2601+
if Some(14) > freebsd_ver =>
2602+
{
2603+
true
2604+
}
2605+
25992606
// FIXME: Removed in FreeBSD 15:
26002607
"LOCAL_CONNWAIT" if freebsd_ver >= Some(15) => true,
26012608

@@ -2716,6 +2723,9 @@ fn test_freebsd(target: &str) {
27162723
true
27172724
}
27182725

2726+
// Those are introduced in FreeBSD 14.1.
2727+
"kcmp" => true,
2728+
27192729
_ => false,
27202730
}
27212731
});

libc-test/semver/freebsd.txt

+6
Original file line numberDiff line numberDiff line change
@@ -689,6 +689,11 @@ JAIL_SYS_DISABLE
689689
JAIL_SYS_INHERIT
690690
JAIL_SYS_NEW
691691
JAIL_UPDATE
692+
KCMP_FILE
693+
KCMP_FILEOBJ
694+
KCMP_FILES
695+
KCMP_SIGHAND
696+
KCMP_VM
692697
KENV_DUMP
693698
KENV_DUMP_LOADER
694699
KENV_DUMP_STATIC
@@ -2007,6 +2012,7 @@ jail_get
20072012
jail_remove
20082013
jail_set
20092014
jrand48
2015+
kcmp
20102016
kevent
20112017
key_t
20122018
killpg

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

+14
Original file line numberDiff line numberDiff line change
@@ -4902,6 +4902,12 @@ pub const TFD_TIMER_CANCEL_ON_SET: ::c_int = 0x02;
49024902

49034903
pub const CLOSE_RANGE_CLOEXEC: ::c_uint = 1 << 2;
49044904

4905+
pub const KCMP_FILE: ::c_int = 100;
4906+
pub const KCMP_FILEOBJ: ::c_int = 101;
4907+
pub const KCMP_FILES: ::c_int = 102;
4908+
pub const KCMP_SIGHAND: ::c_int = 103;
4909+
pub const KCMP_VM: ::c_int = 104;
4910+
49054911
pub const fn MAP_ALIGNED(a: ::c_int) -> ::c_int {
49064912
a << 24
49074913
}
@@ -5625,6 +5631,14 @@ extern "C" {
56255631
argv: *const *const ::c_char,
56265632
envp: *const *const ::c_char,
56275633
) -> ::c_int;
5634+
5635+
pub fn kcmp(
5636+
pid1: ::pid_t,
5637+
pid2: ::pid_t,
5638+
type_: ::c_int,
5639+
idx1: ::c_ulong,
5640+
idx2: ::c_ulong,
5641+
) -> ::c_int;
56285642
}
56295643

56305644
#[link(name = "memstat")]

0 commit comments

Comments
 (0)