Skip to content

Commit d6fe782

Browse files
committed
Auto merge of #3022 - asomers:capsicum, r=JohnTitor
Add more capsicum functions for FreeBSD These have all been available since at least FreeBSD 9.2.
2 parents b8c8e13 + afb665d commit d6fe782

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

libc-test/semver/freebsd.txt

+17
Original file line numberDiff line numberDiff line change
@@ -1509,6 +1509,23 @@ bpf_program
15091509
bpf_stat
15101510
bpf_version
15111511
bsearch
1512+
cap_enter
1513+
cap_getmode
1514+
cap_fcntls_get
1515+
cap_fcntls_limit
1516+
cap_ioctls_get
1517+
cap_ioctls_limit
1518+
__cap_rights_init
1519+
__cap_rights_get
1520+
__cap_rights_set
1521+
__cap_rights_clear
1522+
__cap_rights_is_set
1523+
cap_rights_is_valid
1524+
cap_rights_limit
1525+
cap_rights_merge
1526+
cap_rights_remove
1527+
cap_rights_contains
1528+
cap_sandboxed
15121529
cfmakesane
15131530
chflags
15141531
chflagsat

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

+6
Original file line numberDiff line numberDiff line change
@@ -4292,8 +4292,13 @@ extern "C" {
42924292
pub fn cpuset_setid(which: cpuwhich_t, id: ::id_t, setid: ::cpusetid_t) -> ::c_int;
42934293
pub fn cap_enter() -> ::c_int;
42944294
pub fn cap_getmode(modep: *mut ::c_uint) -> ::c_int;
4295+
pub fn cap_fcntls_get(fd: ::c_int, fcntlrightsp: *mut u32) -> ::c_int;
4296+
pub fn cap_fcntls_limit(fd: ::c_int, fcntlrights: u32) -> ::c_int;
4297+
pub fn cap_ioctls_get(fd: ::c_int, cmds: *mut u_long, maxcmds: usize) -> isize;
4298+
pub fn cap_ioctls_limit(fd: ::c_int, cmds: *const u_long, ncmds: usize) -> ::c_int;
42954299
pub fn __cap_rights_init(version: ::c_int, rights: *mut cap_rights_t, ...)
42964300
-> *mut cap_rights_t;
4301+
pub fn __cap_rights_get(version: ::c_int, fd: ::c_int, rightsp: *mut cap_rights_t) -> ::c_int;
42974302
pub fn __cap_rights_set(rights: *mut cap_rights_t, ...) -> *mut cap_rights_t;
42984303
pub fn __cap_rights_clear(rights: *mut cap_rights_t, ...) -> *mut cap_rights_t;
42994304
pub fn __cap_rights_is_set(rights: *const cap_rights_t, ...) -> bool;
@@ -4303,6 +4308,7 @@ extern "C" {
43034308
pub fn cap_rights_remove(dst: *mut cap_rights_t, src: *const cap_rights_t)
43044309
-> *mut cap_rights_t;
43054310
pub fn cap_rights_contains(big: *const cap_rights_t, little: *const cap_rights_t) -> bool;
4311+
pub fn cap_sandboxed() -> bool;
43064312

43074313
pub fn reallocarray(ptr: *mut ::c_void, nmemb: ::size_t, size: ::size_t) -> *mut ::c_void;
43084314

0 commit comments

Comments
 (0)