summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThom Chiovoloni <thom@shift.click>2022-08-18 17:04:28 -0700
committerThom Chiovoloni <thom@shift.click>2022-08-18 17:04:28 -0700
commit52199a640ac8f6447f2dda0e026e8ff47714372d (patch)
tree54e11c30a1fbbdbd52a0031ed952b7fe22b369a0 /src
parent2c7f384d915071692f9353825cb896640b3f30ef (diff)
downloadrust-libc-52199a640ac8f6447f2dda0e026e8ff47714372d.tar.gz
Add `confstr` and guaranteed `_CS_*` constants on apple
Diffstat (limited to 'src')
-rw-r--r--src/unix/bsd/apple/mod.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs
index a831ca850f..9fc5159a18 100644
--- a/src/unix/bsd/apple/mod.rs
+++ b/src/unix/bsd/apple/mod.rs
@@ -3796,6 +3796,11 @@ pub const _SC_TRACE_NAME_MAX: ::c_int = 128;
pub const _SC_TRACE_SYS_MAX: ::c_int = 129;
pub const _SC_TRACE_USER_EVENT_MAX: ::c_int = 130;
pub const _SC_PASS_MAX: ::c_int = 131;
+// `confstr` keys (only the values guaranteed by `man confstr`).
+pub const _CS_PATH: ::c_int = 1;
+pub const _CS_DARWIN_USER_DIR: ::c_int = 65536;
+pub const _CS_DARWIN_USER_TEMP_DIR: ::c_int = 65537;
+pub const _CS_DARWIN_USER_CACHE_DIR: ::c_int = 65538;
pub const PTHREAD_MUTEX_NORMAL: ::c_int = 0;
pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 1;
@@ -4846,6 +4851,11 @@ extern "C" {
pub fn fchflags(fd: ::c_int, flags: ::c_uint) -> ::c_int;
pub fn clock_getres(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
pub fn clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
+ #[cfg_attr(
+ all(target_os = "macos", target_arch = "x86"),
+ link_name = "confstr$UNIX2003"
+ )]
+ pub fn confstr(name: ::c_int, buf: *mut ::c_char, len: ::size_t) -> ::size_t;
pub fn lio_listio(
mode: ::c_int,
aiocb_list: *const *mut aiocb,