Skip to content

Commit 0e28c86

Browse files
authored
Merge pull request #3746 from devnexen/fbsd_kcmp
freebsd kcmp call support.
2 parents 2a2f507 + 68ebe1d commit 0e28c86

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
@@ -2408,6 +2408,13 @@ fn test_freebsd(target: &str) {
24082408
true
24092409
}
24102410

2411+
// Added in FreeBSD 14.1
2412+
"KCMP_FILE" | "KCMP_FILEOBJ" | "KCMP_FILES" | "KCMP_SIGHAND" | "KCMP_VM"
2413+
if Some(14) > freebsd_ver =>
2414+
{
2415+
true
2416+
}
2417+
24112418
// FIXME: Removed in FreeBSD 15:
24122419
"LOCAL_CONNWAIT" => true,
24132420

@@ -2521,6 +2528,9 @@ fn test_freebsd(target: &str) {
25212528
true
25222529
}
25232530

2531+
// Those are introduced in FreeBSD 14.1.
2532+
"kcmp" => true,
2533+
25242534
_ => false,
25252535
}
25262536
});

libc-test/semver/freebsd.txt

+6
Original file line numberDiff line numberDiff line change
@@ -686,6 +686,11 @@ JAIL_SYS_DISABLE
686686
JAIL_SYS_INHERIT
687687
JAIL_SYS_NEW
688688
JAIL_UPDATE
689+
KCMP_FILE
690+
KCMP_FILEOBJ
691+
KCMP_FILES
692+
KCMP_SIGHAND
693+
KCMP_VM
689694
KENV_GET
690695
KENV_SET
691696
KENV_UNSET
@@ -1972,6 +1977,7 @@ jail_get
19721977
jail_remove
19731978
jail_set
19741979
jrand48
1980+
kcmp
19751981
kevent
19761982
key_t
19771983
killpg

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

+14
Original file line numberDiff line numberDiff line change
@@ -4801,6 +4801,12 @@ pub const TFD_CLOEXEC: ::c_int = O_CLOEXEC;
48014801
pub const TFD_TIMER_ABSTIME: ::c_int = 0x01;
48024802
pub const TFD_TIMER_CANCEL_ON_SET: ::c_int = 0x02;
48034803

4804+
pub const KCMP_FILE: ::c_int = 100;
4805+
pub const KCMP_FILEOBJ: ::c_int = 101;
4806+
pub const KCMP_FILES: ::c_int = 102;
4807+
pub const KCMP_SIGHAND: ::c_int = 103;
4808+
pub const KCMP_VM: ::c_int = 104;
4809+
48044810
pub const fn MAP_ALIGNED(a: ::c_int) -> ::c_int {
48054811
a << 24
48064812
}
@@ -5520,6 +5526,14 @@ extern "C" {
55205526
) -> ::c_int;
55215527
pub fn closefrom(lowfd: ::c_int);
55225528
pub fn close_range(lowfd: ::c_uint, highfd: ::c_uint, flags: ::c_int) -> ::c_int;
5529+
5530+
pub fn kcmp(
5531+
pid1: ::pid_t,
5532+
pid2: ::pid_t,
5533+
type_: ::c_int,
5534+
idx1: ::c_ulong,
5535+
idx2: ::c_ulong,
5536+
) -> ::c_int;
55235537
}
55245538

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

0 commit comments

Comments
 (0)