diff options
author | bors <bors@rust-lang.org> | 2021-05-23 14:20:28 +0000 |
---|---|---|
committer | bors <bors@rust-lang.org> | 2021-05-23 14:20:28 +0000 |
commit | 02887baad33f2a7ffadd89ff842eeef43557249c (patch) | |
tree | 087dda4af9a7ac55c800aa3155e0f5f194f6a3b8 | |
parent | c2e02e8e28460be070df57d3fe81cc63909601e2 (diff) | |
parent | 0fe1d89466a725f64f350f6177b2f5e88b3aa452 (diff) | |
download | rust-libc-02887baad33f2a7ffadd89ff842eeef43557249c.tar.gz |
Auto merge of #2191 - devnexen:macos_libproc_api, r=JohnTitor
apple adding subset of the most used libproc api
-rwxr-xr-x | libc-test/build.rs | 1 | ||||
-rw-r--r-- | libc-test/semver/apple.txt | 4 | ||||
-rw-r--r-- | src/unix/bsd/apple/mod.rs | 16 |
3 files changed, 21 insertions, 0 deletions
diff --git a/libc-test/build.rs b/libc-test/build.rs index f34e886974..6285706f84 100755 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -184,6 +184,7 @@ fn test_apple(target: &str) { "iconv.h", "ifaddrs.h", "langinfo.h", + "libproc.h", "limits.h", "locale.h", "mach-o/dyld.h", diff --git a/libc-test/semver/apple.txt b/libc-test/semver/apple.txt index 4be61f9271..a95e0d5285 100644 --- a/libc-test/semver/apple.txt +++ b/libc-test/semver/apple.txt @@ -1726,6 +1726,10 @@ posix_spawnattr_t posix_spawnp preadv proc_bsdinfo +proc_name +proc_pidinfo +proc_pidfdinfo +proc_pidpath proc_taskallinfo proc_taskinfo proc_threadinfo diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs index 1190ee0121..7a2f0ed7bb 100644 --- a/src/unix/bsd/apple/mod.rs +++ b/src/unix/bsd/apple/mod.rs @@ -4049,6 +4049,22 @@ extern "C" { // Added in macOS 10.13 // ISO/IEC 9899:2011 ("ISO C11") K.3.7.4.1 pub fn memset_s(s: *mut ::c_void, smax: ::size_t, c: ::c_int, n: ::size_t) -> ::c_int; + pub fn proc_pidinfo( + pid: ::c_int, + flavor: ::c_int, + arg: u64, + buffer: *mut ::c_void, + buffersize: ::c_int, + ) -> ::c_int; + pub fn proc_pidfdinfo( + pid: ::c_int, + fd: ::c_int, + flavor: ::c_int, + buffer: *mut ::c_void, + buffersize: ::c_int, + ) -> ::c_int; + pub fn proc_pidpath(pid: ::c_int, buffer: *mut ::c_void, buffersize: u32) -> ::c_int; + pub fn proc_name(pid: ::c_int, buffer: *mut ::c_void, buffersize: u32) -> ::c_int; } #[link(name = "iconv")] |