Skip to content

Commit e44b6d0

Browse files
committed
procctl for freebsd 15 upgrade.
adding missing PROC_SPROTECT helpers while at it. ref: https://github.com/freebsd/freebsd-src/blob/c992ac6213276f54d868f317cc5092f8aed4ff54/sys/sys/procctl.h#L68
1 parent e2404b4 commit e44b6d0

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

libc-test/build.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2741,6 +2741,9 @@ fn test_freebsd(target: &str) {
27412741
// Added in FreeBSD 14.2
27422742
"SO_SPLICE" if Some(14) > freebsd_ver => true,
27432743

2744+
// Added in FreeBSD 15
2745+
"PROC_LOGSIGEXIT_CTL" | "PROC_LOGSIGEXIT_STATUS" if Some(15) > freebsd_ver => true,
2746+
27442747
_ => false,
27452748
}
27462749
});

libc-test/semver/freebsd.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,6 +1046,12 @@ POSIX_SPAWN_SETSCHEDPARAM
10461046
POSIX_SPAWN_SETSCHEDULER
10471047
POSIX_SPAWN_SETSIGDEF
10481048
POSIX_SPAWN_SETSIGMASK
1049+
PPROC_CLEAR
1050+
PPROC_DESCEND
1051+
PPROC_FLAGS
1052+
PPROC_INHERIT
1053+
PPROC_OP
1054+
PPROC_SET
10491055
PPPDISC
10501056
PROC_NO_NEW_PRIVS_CTL
10511057
PROC_NO_NEW_PRIVS_DISABLE

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3012,6 +3012,8 @@ pub const PROC_NO_NEW_PRIVS_STATUS: c_int = 20;
30123012
pub const PROC_WXMAP_CTL: c_int = 21;
30133013
pub const PROC_WXMAP_STATUS: c_int = 22;
30143014
pub const PROC_PROCCTL_MD_MIN: c_int = 0x10000000;
3015+
pub const PROC_LOGSIGEXIT_CTL: c_int = 23;
3016+
pub const PROC_LOGSIGEXIT_STATUS: c_int = 24;
30153017

30163018
pub const PPROT_SET: c_int = 1;
30173019
pub const PPROT_CLEAR: c_int = 2;
@@ -4788,6 +4790,14 @@ safe_f! {
47884790
pub {const} fn PR_SCTP_VALID_POLICY(x: c_int) -> bool {
47894791
PR_SCTP_POLICY(x) <= SCTP_PR_SCTP_MAX
47904792
}
4793+
4794+
pub {const} fn PPROT_OP(o: c_int) -> c_int {
4795+
o & 0xf
4796+
}
4797+
4798+
pub {const} fn PPROT_FLAGS(o: c_int) -> c_int {
4799+
o & !0xf
4800+
}
47914801
}
47924802

47934803
cfg_if! {

0 commit comments

Comments
 (0)