Skip to content

Commit

Permalink
Add mach_error_string (and mach_error_t)
Browse files Browse the repository at this point in the history
  • Loading branch information
stepancheg committed Sep 10, 2024
1 parent 2c0250f commit 03c5f39
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions libc-test/semver/apple.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1912,6 +1912,8 @@ lockf
log2phys
login_tty
lutimes
mach_error_string
mach_error_t
madvise
malloc_default_zone
malloc_good_size
Expand Down
5 changes: 5 additions & 0 deletions src/unix/bsd/apple/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ pub type thread_inspect_t = ::mach_port_t;
pub type thread_act_t = ::mach_port_t;
pub type thread_act_array_t = *mut ::thread_act_t;
pub type policy_t = ::c_int;
// https://developer.apple.com/documentation/kernel/mach_error_t
pub type mach_error_t = ::kern_return_t;
pub type mach_vm_address_t = u64;
pub type mach_vm_offset_t = u64;
pub type mach_vm_size_t = u64;
Expand Down Expand Up @@ -6202,6 +6204,9 @@ extern "C" {
pub fn copyfile_state_get(s: copyfile_state_t, flags: u32, dst: *mut ::c_void) -> ::c_int;
pub fn copyfile_state_set(s: copyfile_state_t, flags: u32, src: *const ::c_void) -> ::c_int;

// https://opensource.apple.com/source/xnu/xnu-2422.1.72/libsyscall/mach/mach/mach_error.h.auto.html
pub fn mach_error_string(error_value: ::mach_error_t) -> *mut ::c_char;

// 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;
Expand Down

0 comments on commit 03c5f39

Please sign in to comment.