Skip to content

Commit 02887ba

Browse files
committed
Auto merge of #2191 - devnexen:macos_libproc_api, r=JohnTitor
apple adding subset of the most used libproc api
2 parents c2e02e8 + 0fe1d89 commit 02887ba

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
@@ -1726,6 +1726,10 @@ posix_spawnattr_t
17261726
posix_spawnp
17271727
preadv
17281728
proc_bsdinfo
1729+
proc_name
1730+
proc_pidinfo
1731+
proc_pidfdinfo
1732+
proc_pidpath
17291733
proc_taskallinfo
17301734
proc_taskinfo
17311735
proc_threadinfo

src/unix/bsd/apple/mod.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4049,6 +4049,22 @@ extern "C" {
40494049
// Added in macOS 10.13
40504050
// ISO/IEC 9899:2011 ("ISO C11") K.3.7.4.1
40514051
pub fn memset_s(s: *mut ::c_void, smax: ::size_t, c: ::c_int, n: ::size_t) -> ::c_int;
4052+
pub fn proc_pidinfo(
4053+
pid: ::c_int,
4054+
flavor: ::c_int,
4055+
arg: u64,
4056+
buffer: *mut ::c_void,
4057+
buffersize: ::c_int,
4058+
) -> ::c_int;
4059+
pub fn proc_pidfdinfo(
4060+
pid: ::c_int,
4061+
fd: ::c_int,
4062+
flavor: ::c_int,
4063+
buffer: *mut ::c_void,
4064+
buffersize: ::c_int,
4065+
) -> ::c_int;
4066+
pub fn proc_pidpath(pid: ::c_int, buffer: *mut ::c_void, buffersize: u32) -> ::c_int;
4067+
pub fn proc_name(pid: ::c_int, buffer: *mut ::c_void, buffersize: u32) -> ::c_int;
40524068
}
40534069

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

0 commit comments

Comments
 (0)