Skip to content

Commit d8ff07b

Browse files
authored
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; ```
1 parent 1566923 commit d8ff07b

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
@@ -1913,6 +1913,8 @@ lockf
19131913
log2phys
19141914
login_tty
19151915
lutimes
1916+
mach_error_string
1917+
mach_error_t
19161918
madvise
19171919
malloc_default_zone
19181920
malloc_good_size

src/unix/bsd/apple/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ pub type thread_inspect_t = ::mach_port_t;
5858
pub type thread_act_t = ::mach_port_t;
5959
pub type thread_act_array_t = *mut ::thread_act_t;
6060
pub type policy_t = ::c_int;
61+
pub type mach_error_t = ::kern_return_t;
6162
pub type mach_vm_address_t = u64;
6263
pub type mach_vm_offset_t = u64;
6364
pub type mach_vm_size_t = u64;
@@ -6209,6 +6210,8 @@ extern "C" {
62096210
pub fn copyfile_state_get(s: copyfile_state_t, flags: u32, dst: *mut ::c_void) -> ::c_int;
62106211
pub fn copyfile_state_set(s: copyfile_state_t, flags: u32, src: *const ::c_void) -> ::c_int;
62116212

6213+
pub fn mach_error_string(error_value: ::mach_error_t) -> *mut ::c_char;
6214+
62126215
// Added in macOS 10.13
62136216
// ISO/IEC 9899:2011 ("ISO C11") K.3.7.4.1
62146217
pub fn memset_s(s: *mut ::c_void, smax: ::size_t, c: ::c_int, n: ::size_t) -> ::c_int;

0 commit comments

Comments
 (0)