Skip to content

Commit 9606af1

Browse files
stepanchegtgross35
authored andcommitted
Add mach_error_string (and mach_error_t) (#3913)
`mach_error_string` is defined in `/usr/include/mach/mach_error.h` It is not referenced in the documentation Apple website. ``` char *mach_error_string( /* * Returns a string appropriate to the error argument given */ mach_error_t error_value ); ``` `mach_error_t` is defined in `/usr/include/mach/error.h` https://developer.apple.com/documentation/kernel/mach_error_t ``` typedef kern_return_t mach_error_t; ``` (backport <#3913>) (cherry picked from commit d8ff07b)
1 parent ccbcfbb commit 9606af1

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

libc-test/semver/apple.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2020,6 +2020,8 @@ log2phys
20202020
login_tty
20212021
lutimes
20222022
mach_absolute_time
2023+
mach_error_string
2024+
mach_error_t
20232025
mach_header
20242026
mach_header_64
20252027
mach_host_self

src/unix/bsd/apple/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ pub type thread_inspect_t = ::mach_port_t;
5656
pub type thread_act_t = ::mach_port_t;
5757
pub type thread_act_array_t = *mut ::thread_act_t;
5858
pub type policy_t = ::c_int;
59+
pub type mach_error_t = ::kern_return_t;
5960
pub type mach_vm_address_t = u64;
6061
pub type mach_vm_offset_t = u64;
6162
pub type mach_vm_size_t = u64;
@@ -6330,6 +6331,8 @@ extern "C" {
63306331
pub fn copyfile_state_get(s: copyfile_state_t, flags: u32, dst: *mut ::c_void) -> ::c_int;
63316332
pub fn copyfile_state_set(s: copyfile_state_t, flags: u32, src: *const ::c_void) -> ::c_int;
63326333

6334+
pub fn mach_error_string(error_value: ::mach_error_t) -> *mut ::c_char;
6335+
63336336
// Added in macOS 10.13
63346337
// ISO/IEC 9899:2011 ("ISO C11") K.3.7.4.1
63356338
pub fn memset_s(s: *mut ::c_void, smax: ::size_t, c: ::c_int, n: ::size_t) -> ::c_int;

0 commit comments

Comments
 (0)