Skip to content

Commit 03c5f39

Browse files
committed
Add mach_error_string (and mach_error_t)
1 parent 2c0250f commit 03c5f39

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

libc-test/semver/apple.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1912,6 +1912,8 @@ lockf
19121912
log2phys
19131913
login_tty
19141914
lutimes
1915+
mach_error_string
1916+
mach_error_t
19151917
madvise
19161918
malloc_default_zone
19171919
malloc_good_size

src/unix/bsd/apple/mod.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ 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+
// https://developer.apple.com/documentation/kernel/mach_error_t
62+
pub type mach_error_t = ::kern_return_t;
6163
pub type mach_vm_address_t = u64;
6264
pub type mach_vm_offset_t = u64;
6365
pub type mach_vm_size_t = u64;
@@ -6202,6 +6204,9 @@ extern "C" {
62026204
pub fn copyfile_state_get(s: copyfile_state_t, flags: u32, dst: *mut ::c_void) -> ::c_int;
62036205
pub fn copyfile_state_set(s: copyfile_state_t, flags: u32, src: *const ::c_void) -> ::c_int;
62046206

6207+
// https://opensource.apple.com/source/xnu/xnu-2422.1.72/libsyscall/mach/mach/mach_error.h.auto.html
6208+
pub fn mach_error_string(error_value: ::mach_error_t) -> *mut ::c_char;
6209+
62056210
// Added in macOS 10.13
62066211
// ISO/IEC 9899:2011 ("ISO C11") K.3.7.4.1
62076212
pub fn memset_s(s: *mut ::c_void, smax: ::size_t, c: ::c_int, n: ::size_t) -> ::c_int;

0 commit comments

Comments
 (0)