Skip to content

Commit 0fe1d89

Browse files
committed
apple adding subset of the most used libproc api
1 parent 23c29a0 commit 0fe1d89

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

libc-test/build.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ fn test_apple(target: &str) {
184184
"iconv.h",
185185
"ifaddrs.h",
186186
"langinfo.h",
187+
"libproc.h",
187188
"limits.h",
188189
"locale.h",
189190
"mach-o/dyld.h",

libc-test/semver/apple.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1661,6 +1661,10 @@ posix_spawnattr_t
16611661
posix_spawnp
16621662
preadv
16631663
proc_bsdinfo
1664+
proc_name
1665+
proc_pidinfo
1666+
proc_pidfdinfo
1667+
proc_pidpath
16641668
proc_taskallinfo
16651669
proc_taskinfo
16661670
proc_threadinfo

src/unix/bsd/apple/mod.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3882,6 +3882,22 @@ extern "C" {
38823882
// Added in macOS 10.13
38833883
// ISO/IEC 9899:2011 ("ISO C11") K.3.7.4.1
38843884
pub fn memset_s(s: *mut ::c_void, smax: ::size_t, c: ::c_int, n: ::size_t) -> ::c_int;
3885+
pub fn proc_pidinfo(
3886+
pid: ::c_int,
3887+
flavor: ::c_int,
3888+
arg: u64,
3889+
buffer: *mut ::c_void,
3890+
buffersize: ::c_int,
3891+
) -> ::c_int;
3892+
pub fn proc_pidfdinfo(
3893+
pid: ::c_int,
3894+
fd: ::c_int,
3895+
flavor: ::c_int,
3896+
buffer: *mut ::c_void,
3897+
buffersize: ::c_int,
3898+
) -> ::c_int;
3899+
pub fn proc_pidpath(pid: ::c_int, buffer: *mut ::c_void, buffersize: u32) -> ::c_int;
3900+
pub fn proc_name(pid: ::c_int, buffer: *mut ::c_void, buffersize: u32) -> ::c_int;
38853901
}
38863902

38873903
#[link(name = "iconv")]

0 commit comments

Comments
 (0)