Skip to content

Commit 52199a6

Browse files
committed
Add confstr and guaranteed _CS_* constants on apple
1 parent 2c7f384 commit 52199a6

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

libc-test/semver/apple.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1507,6 +1507,10 @@ XATTR_SHOWCOMPRESSION
15071507
XUCRED_VERSION
15081508
YESEXPR
15091509
YESSTR
1510+
_CS_PATH
1511+
_CS_DARWIN_USER_DIR
1512+
_CS_DARWIN_USER_TEMP_DIR
1513+
_CS_DARWIN_USER_CACHE_DIR
15101514
_IOFBF
15111515
_IOLBF
15121516
_IONBF
@@ -1681,6 +1685,7 @@ clock_getres
16811685
clonefile
16821686
clonefileat
16831687
cmsghdr
1688+
confstr
16841689
connectx
16851690
copyfile
16861691
copyfile_flags_t

src/unix/bsd/apple/mod.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3796,6 +3796,11 @@ pub const _SC_TRACE_NAME_MAX: ::c_int = 128;
37963796
pub const _SC_TRACE_SYS_MAX: ::c_int = 129;
37973797
pub const _SC_TRACE_USER_EVENT_MAX: ::c_int = 130;
37983798
pub const _SC_PASS_MAX: ::c_int = 131;
3799+
// `confstr` keys (only the values guaranteed by `man confstr`).
3800+
pub const _CS_PATH: ::c_int = 1;
3801+
pub const _CS_DARWIN_USER_DIR: ::c_int = 65536;
3802+
pub const _CS_DARWIN_USER_TEMP_DIR: ::c_int = 65537;
3803+
pub const _CS_DARWIN_USER_CACHE_DIR: ::c_int = 65538;
37993804

38003805
pub const PTHREAD_MUTEX_NORMAL: ::c_int = 0;
38013806
pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 1;
@@ -4846,6 +4851,11 @@ extern "C" {
48464851
pub fn fchflags(fd: ::c_int, flags: ::c_uint) -> ::c_int;
48474852
pub fn clock_getres(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
48484853
pub fn clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
4854+
#[cfg_attr(
4855+
all(target_os = "macos", target_arch = "x86"),
4856+
link_name = "confstr$UNIX2003"
4857+
)]
4858+
pub fn confstr(name: ::c_int, buf: *mut ::c_char, len: ::size_t) -> ::size_t;
48494859
pub fn lio_listio(
48504860
mode: ::c_int,
48514861
aiocb_list: *const *mut aiocb,

0 commit comments

Comments
 (0)