Skip to content

Commit

Permalink
freebsd procctl flags update
Browse files Browse the repository at this point in the history
  • Loading branch information
devnexen authored and tatref committed Mar 20, 2023
1 parent 6b9bc9f commit 9600b44
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
9 changes: 9 additions & 0 deletions libc-test/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2102,6 +2102,15 @@ fn test_freebsd(target: &str) {
| "PROC_PROTMAX_FORCE_DISABLE"
| "PROC_PROTMAX_NOFORCE"
| "PROC_PROTMAX_ACTIVE"
| "PROC_NO_NEW_PRIVS_CTL"
| "PROC_NO_NEW_PRIVS_STATUS"
| "PROC_NO_NEW_PRIVS_ENABLE"
| "PROC_NO_NEW_PRIVS_DISABLE"
| "PROC_WXMAP_CTL"
| "PROC_WXMAP_STATUS"
| "PROC_WX_MAPPINGS_PERMIT"
| "PROC_WX_MAPPINGS_DISALLOW_EXEC"
| "PROC_WXORX_ENFORCE"
if Some(13) > freebsd_ver =>
{
true
Expand Down
11 changes: 10 additions & 1 deletion libc-test/semver/freebsd.txt
Original file line number Diff line number Diff line change
Expand Up @@ -911,6 +911,10 @@ POSIX_SPAWN_SETSCHEDULER
POSIX_SPAWN_SETSIGDEF
POSIX_SPAWN_SETSIGMASK
PPPDISC
PROC_NO_NEW_PRIVS_CTL
PROC_NO_NEW_PRIVS_DISABLE
PROC_NO_NEW_PRIVS_ENABLE
PROC_NO_NEW_PRIVS_STATUS
PROC_PDEATHSIG_CTL
PROC_PDEATHSIG_STATUS
PROC_REAP_ACQUIRE
Expand All @@ -924,6 +928,11 @@ PROC_TRACE_CTL
PROC_TRACE_STATUS
PROC_TRAPCAP_CTL
PROC_TRAPCAP_STATUS
PROC_WX_MAPPINGS_DISALLOW_EXEC
PROC_WX_MAPPINGS_PERMIT
PROC_WXMAP_CTL
PROC_WXMAP_STATUS
PROC_WXORX_ENFORCE
PTHREAD_CREATE_DETACHED
PTHREAD_CREATE_JOINABLE
PTHREAD_MUTEX_ADAPTIVE_NP
Expand Down Expand Up @@ -1927,4 +1936,4 @@ xallocx
xucred
eaccess
dirname
basename
basename
11 changes: 11 additions & 0 deletions src/unix/bsd/freebsdlike/freebsd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2379,6 +2379,10 @@ pub const PROC_PROTMAX_CTL: ::c_int = 15;
pub const PROC_PROTMAX_STATUS: ::c_int = 16;
pub const PROC_STACKGAP_CTL: ::c_int = 17;
pub const PROC_STACKGAP_STATUS: ::c_int = 18;
pub const PROC_NO_NEW_PRIVS_CTL: ::c_int = 19;
pub const PROC_NO_NEW_PRIVS_STATUS: ::c_int = 20;
pub const PROC_WXMAP_CTL: ::c_int = 21;
pub const PROC_WXMAP_STATUS: ::c_int = 22;
pub const PROC_PROCCTL_MD_MIN: ::c_int = 0x10000000;

pub const PPROT_SET: ::c_int = 1;
Expand Down Expand Up @@ -2408,6 +2412,13 @@ pub const PROC_STACKGAP_DISABLE: ::c_int = 0x0002;
pub const PROC_STACKGAP_ENABLE_EXEC: ::c_int = 0x0004;
pub const PROC_STACKGAP_DISABLE_EXEC: ::c_int = 0x0008;

pub const PROC_NO_NEW_PRIVS_ENABLE: ::c_int = 1;
pub const PROC_NO_NEW_PRIVS_DISABLE: ::c_int = 2;

pub const PROC_WX_MAPPINGS_PERMIT: ::c_int = 0x0001;
pub const PROC_WX_MAPPINGS_DISALLOW_EXEC: ::c_int = 0x0002;
pub const PROC_WXORX_ENFORCE: ::c_int = 0x80000000;

pub const AF_SLOW: ::c_int = 33;
pub const AF_SCLUSTER: ::c_int = 34;
pub const AF_ARP: ::c_int = 35;
Expand Down

0 comments on commit 9600b44

Please sign in to comment.