Skip to content

libc: update macOS headers to SDK 15.2 #23845

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/libc/darwin/SDKSettings.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"MinimalDisplayName":"15.1"}
{"MinimalDisplayName":"15.2"}
154 changes: 75 additions & 79 deletions lib/libc/darwin/libSystem.tbd

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions lib/libc/include/any-macos-any/AvailabilityInternal.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,37 +36,37 @@
#if defined(__has_builtin) && __has_builtin(__is_target_os)
#if __is_target_os(macos)
#define __MAC_OS_X_VERSION_MIN_REQUIRED __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__
#define __MAC_OS_X_VERSION_MAX_ALLOWED __MAC_15_1
#define __MAC_OS_X_VERSION_MAX_ALLOWED __MAC_15_2
#endif
#elif __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
#define __MAC_OS_X_VERSION_MIN_REQUIRED __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
#define __MAC_OS_X_VERSION_MAX_ALLOWED __MAC_15_1
#define __MAC_OS_X_VERSION_MAX_ALLOWED __MAC_15_2
#endif /* __has_builtin(__is_target_os) && __is_target_os(macos) */
#endif /* __MAC_OS_X_VERSION_MIN_REQUIRED */

#ifndef __IPHONE_OS_VERSION_MIN_REQUIRED
#if defined(__has_builtin) && __has_builtin(__is_target_os)
#if __is_target_os(ios)
#define __IPHONE_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__
#define __IPHONE_OS_VERSION_MAX_ALLOWED __IPHONE_18_1
#define __IPHONE_OS_VERSION_MAX_ALLOWED __IPHONE_18_2
#endif
#elif __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__
#define __IPHONE_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__
#define __IPHONE_OS_VERSION_MAX_ALLOWED __IPHONE_18_1
#define __IPHONE_OS_VERSION_MAX_ALLOWED __IPHONE_18_2
#endif /* __has_builtin(__is_target_os) && __is_target_os(ios) */
#endif /* __IPHONE_OS_VERSION_MIN_REQUIRED */

#ifndef __WATCH_OS_VERSION_MIN_REQUIRED
#if defined(__has_builtin) && __has_builtin(__is_target_os)
#if __is_target_os(watchos)
#define __WATCH_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__
#define __WATCH_OS_VERSION_MAX_ALLOWED __WATCHOS_11_1
#define __WATCH_OS_VERSION_MAX_ALLOWED __WATCHOS_11_2
/* for compatibility with existing code. New code should use platform specific checks */
#define __IPHONE_OS_VERSION_MIN_REQUIRED __IPHONE_9_0
#endif
#elif __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__
#define __WATCH_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__
#define __WATCH_OS_VERSION_MAX_ALLOWED __WATCHOS_11_1
#define __WATCH_OS_VERSION_MAX_ALLOWED __WATCHOS_11_2
/* for compatibility with existing code. New code should use platform specific checks */
#define __IPHONE_OS_VERSION_MIN_REQUIRED __IPHONE_9_0
#endif /* __has_builtin(__is_target_os) && __is_target_os(watchos) */
Expand All @@ -76,13 +76,13 @@
#if defined(__has_builtin) && __has_builtin(__is_target_os)
#if __is_target_os(tvos)
#define __TV_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__
#define __TV_OS_VERSION_MAX_ALLOWED __TVOS_18_1
#define __TV_OS_VERSION_MAX_ALLOWED __TVOS_18_2
/* for compatibility with existing code. New code should use platform specific checks */
#define __IPHONE_OS_VERSION_MIN_REQUIRED __IPHONE_9_0
#endif
#elif __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__
#define __TV_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__
#define __TV_OS_VERSION_MAX_ALLOWED __TVOS_18_1
#define __TV_OS_VERSION_MAX_ALLOWED __TVOS_18_2
/* for compatibility with existing code. New code should use platform specific checks */
#define __IPHONE_OS_VERSION_MIN_REQUIRED __IPHONE_9_0
#endif /* __has_builtin(__is_target_os) && __is_target_os(tvos) */
Expand All @@ -92,7 +92,7 @@
#if defined(__has_builtin) && __has_builtin(__is_target_os)
#if __is_target_os(bridgeos)
#define __BRIDGE_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__
#define __BRIDGE_OS_VERSION_MAX_ALLOWED __BRIDGEOS_9_1
#define __BRIDGE_OS_VERSION_MAX_ALLOWED __BRIDGEOS_9_2
/* for compatibility with existing code. New code should use platform specific checks */
#define __IPHONE_OS_VERSION_MIN_REQUIRED __IPHONE_11_0
#endif
Expand All @@ -103,7 +103,7 @@
#if defined(__has_builtin) && __has_builtin(__is_target_os)
#if __is_target_os(driverkit)
#define __DRIVERKIT_VERSION_MIN_REQUIRED __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__
#define __DRIVERKIT_VERSION_MAX_ALLOWED __DRIVERKIT_24_1
#define __DRIVERKIT_VERSION_MAX_ALLOWED __DRIVERKIT_24_2
#endif
#endif /* __has_builtin(__is_target_os) && __is_target_os(driverkit) */
#endif /* __DRIVERKIT_VERSION_MIN_REQUIRED */
Expand All @@ -112,7 +112,7 @@
#if defined(__has_builtin) && __has_builtin(__is_target_os)
#if __is_target_os(visionos)
#define __VISION_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__
#define __VISION_OS_VERSION_MAX_ALLOWED __VISIONOS_2_1
#define __VISION_OS_VERSION_MAX_ALLOWED __VISIONOS_2_2
/* for compatibility with existing code. New code should use platform specific checks */
#define __IPHONE_OS_VERSION_MIN_REQUIRED __IPHONE_17_1
#endif
Expand Down
5 changes: 3 additions & 2 deletions lib/libc/include/any-macos-any/AvailabilityMacros.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,12 @@

*/

#include <AvailabilityVersions.h>

#ifndef __AVAILABILITYMACROS__
#define __AVAILABILITYMACROS__

#include <AvailabilityVersions.h>
#include <TargetConditionals.h>

/*
* If min OS not specified, assume 10.4 for intel
* Note: compiler driver may set _ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED_ based on MACOSX_DEPLOYMENT_TARGET environment variable
Expand Down
8 changes: 8 additions & 0 deletions lib/libc/include/any-macos-any/AvailabilityVersions.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
#define __MAC_14_5 140500
#define __MAC_15_0 150000
#define __MAC_15_1 150100
#define __MAC_15_2 150200
/* __MAC__NA is not defined to a value but is used as a token by macros to indicate that the API is unavailable */

#define __IPHONE_2_0 20000
Expand Down Expand Up @@ -172,6 +173,7 @@
#define __IPHONE_17_5 170500
#define __IPHONE_18_0 180000
#define __IPHONE_18_1 180100
#define __IPHONE_18_2 180200
/* __IPHONE__NA is not defined to a value but is used as a token by macros to indicate that the API is unavailable */

#define __WATCHOS_1_0 10000
Expand Down Expand Up @@ -223,6 +225,7 @@
#define __WATCHOS_10_5 100500
#define __WATCHOS_11_0 110000
#define __WATCHOS_11_1 110100
#define __WATCHOS_11_2 110200
/* __WATCHOS__NA is not defined to a value but is used as a token by macros to indicate that the API is unavailable */

#define __TVOS_9_0 90000
Expand Down Expand Up @@ -275,6 +278,7 @@
#define __TVOS_17_5 170500
#define __TVOS_18_0 180000
#define __TVOS_18_1 180100
#define __TVOS_18_2 180200
/* __TVOS__NA is not defined to a value but is used as a token by macros to indicate that the API is unavailable */

#define __BRIDGEOS_2_0 20000
Expand Down Expand Up @@ -306,6 +310,7 @@
#define __BRIDGEOS_8_5 80500
#define __BRIDGEOS_9_0 90000
#define __BRIDGEOS_9_1 90100
#define __BRIDGEOS_9_2 90200


#define __DRIVERKIT_19_0 190000
Expand All @@ -323,13 +328,15 @@
#define __DRIVERKIT_23_5 230500
#define __DRIVERKIT_24_0 240000
#define __DRIVERKIT_24_1 240100
#define __DRIVERKIT_24_2 240200
/* __DRIVERKIT__NA is not defined to a value but is used as a token by macros to indicate that the API is unavailable */

#define __VISIONOS_1_0 10000
#define __VISIONOS_1_1 10100
#define __VISIONOS_1_2 10200
#define __VISIONOS_2_0 20000
#define __VISIONOS_2_1 20100
#define __VISIONOS_2_2 20200
/* __VISIONOS__NA is not defined to a value but is used as a token by macros to indicate that the API is unavailable */


Expand Down Expand Up @@ -409,6 +416,7 @@
#define MAC_OS_VERSION_14_5 __MAC_14_5
#define MAC_OS_VERSION_15_0 __MAC_15_0
#define MAC_OS_VERSION_15_1 __MAC_15_1
#define MAC_OS_VERSION_15_2 __MAC_15_2

#endif /* #if (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)) || defined(_DARWIN_C_SOURCE) */

Expand Down
2 changes: 2 additions & 0 deletions lib/libc/include/any-macos-any/iconv.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,12 @@ struct iconv_hooks {
void *data;
};

#ifndef __APPLE__
/*
* Fallbacks aren't supported but type definitions are provided for
* source compatibility.
*/
#endif
typedef void (*iconv_unicode_mb_to_uc_fallback) (const char*,
size_t, void (*write_replacement) (const unsigned int *,
size_t, void*), void*, void*);
Expand Down
6 changes: 6 additions & 0 deletions lib/libc/include/any-macos-any/mach-o/x86_64/reloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
*
* @APPLE_LICENSE_HEADER_END@
*/

#ifndef _MACHO_X86_64_RELOC_H_
#define _MACHO_X86_64_RELOC_H_

/*
* Relocations for x86_64 are a bit different than for other architectures in
* Mach-O: Scattered relocations are not used. Almost all relocations produced
Expand Down Expand Up @@ -183,3 +187,5 @@ enum reloc_type_x86_64
X86_64_RELOC_SIGNED_4, // for signed 32-bit displacement with a -4 addend
X86_64_RELOC_TLV, // for thread local variables
};

#endif /* #ifndef _MACHO_X86_64_RELOC_H_ */
11 changes: 11 additions & 0 deletions lib/libc/include/any-macos-any/mach/i386/vm_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,17 @@ typedef uint64_t vm_map_size_t;

typedef mach_vm_address_t mach_port_context_t;

#if defined(MACH_KERNEL_PRIVATE) || KERNEL_VM_TEST

/*
* These are types used internal to Mach to implement the
* legacy 32-bit VM APIs published by the kernel.
*/
typedef uint32_t vm32_address_t;
typedef uint32_t vm32_offset_t;
typedef uint32_t vm32_size_t;

#endif /* MACH_KERNEL_PRIVATE */

#endif /* ASSEMBLER */

Expand Down
1 change: 1 addition & 0 deletions lib/libc/include/any-macos-any/mach/machine.h
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,7 @@ typedef integer_t cpu_threadtype_t;
#define CPUFAMILY_ARM_COLL 0x2876f5b5
#define CPUFAMILY_ARM_LOBOS 0x5f4dea93
#define CPUFAMILY_ARM_DONAN 0x6f5129ac
#define CPUFAMILY_ARM_BRAVA 0x17d5b93a
#define CPUFAMILY_ARM_TAHITI 0x75d4acb9
#define CPUFAMILY_ARM_TUPAI 0x204526d0

Expand Down
8 changes: 7 additions & 1 deletion lib/libc/include/any-macos-any/mach/vm_behavior.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ typedef int vm_behavior_t;
* These describe expected page reference behavior for
* for a given range of virtual memory. For implementation
* details see vm/vm_fault.c
*
* When making a new VM_BEHAVIOR_*, update tests vm_parameter_validation_[user|kern]
* and their expected results; they deliberately call VM functions with invalid
* behavior values and you may be turning one of those invalid behaviors valid.
*/


Expand All @@ -74,7 +78,9 @@ typedef int vm_behavior_t;
#define VM_BEHAVIOR_REUSABLE ((vm_behavior_t) 8)
#define VM_BEHAVIOR_REUSE ((vm_behavior_t) 9)
#define VM_BEHAVIOR_CAN_REUSE ((vm_behavior_t) 10)
#define VM_BEHAVIOR_PAGEOUT ((vm_behavior_t) 11)
#define VM_BEHAVIOR_PAGEOUT ((vm_behavior_t) 11) /* force page-out of the pages in range (development only) */
#define VM_BEHAVIOR_ZERO ((vm_behavior_t) 12) /* zero pages without faulting in additional pages */

#define VM_BEHAVIOR_LAST_VALID (VM_BEHAVIOR_ZERO)

#endif /*_MACH_VM_BEHAVIOR_H_*/
4 changes: 4 additions & 0 deletions lib/libc/include/any-macos-any/mach/vm_inherit.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ typedef unsigned int vm_inherit_t; /* might want to change this */

/*
* Enumeration of valid values for vm_inherit_t.
*
* When making a new VM_INHERIT_*, update tests vm_parameter_validation_[user|kern]
* and their expected results; they deliberately call VM functions with invalid
* inherit values and you may be turning one of those invalid inherits valid.
*/

#define VM_INHERIT_SHARE ((vm_inherit_t) 0) /* share with child */
Expand Down
4 changes: 4 additions & 0 deletions lib/libc/include/any-macos-any/mach/vm_prot.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ typedef int vm_prot_t;

/*
* Protection values, defined as bits within the vm_prot_t type
*
* When making a new VM_PROT_*, update tests vm_parameter_validation_[user|kern]
* and their expected results; they deliberately call VM functions with invalid
* vm_prot values and you may be turning one of those invalid protections valid.
*/

#define VM_PROT_NONE ((vm_prot_t) 0x00)
Expand Down
4 changes: 4 additions & 0 deletions lib/libc/include/any-macos-any/mach/vm_purgable.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ typedef int vm_purgable_t;

/*
* Enumeration of valid values for vm_purgable_t.
*
* When making a new VM_PURGABLE_*, update tests vm_parameter_validation_[user|kern]
* and their expected results; they deliberately call VM functions with invalid
* values and you may be turning one of those invalid bits valid.
*/
#define VM_PURGABLE_SET_STATE ((vm_purgable_t) 0) /* set state of purgeable object */
#define VM_PURGABLE_GET_STATE ((vm_purgable_t) 1) /* get state of purgeable object */
Expand Down
6 changes: 6 additions & 0 deletions lib/libc/include/any-macos-any/mach/vm_statistics.h
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,12 @@ enum virtual_memory_guard_exception_codes {
/* current accounting postmark */
#define __VM_LEDGER_ACCOUNTING_POSTMARK 2019032600

/*
* When making a new VM_LEDGER_TAG_* or VM_LEDGER_FLAG_*, update tests
* vm_parameter_validation_[user|kern] and their expected results; they
* deliberately call VM functions with invalid ledger values and you may
* be turning one of those invalid tags/flags valid.
*/
/* discrete values: */
#define VM_LEDGER_TAG_NONE 0x00000000
#define VM_LEDGER_TAG_DEFAULT 0x00000001
Expand Down
4 changes: 4 additions & 0 deletions lib/libc/include/any-macos-any/mach/vm_sync.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ typedef unsigned vm_sync_t;

/*
* Synchronization flags, defined as bits within the vm_sync_t type
*
* When making a new VM_SYNC_*, update tests vm_parameter_validation_[user|kern]
* and their expected results; they deliberately call VM functions with invalid
* sync values and you may be turning one of those invalid syncs valid.
*/

#define VM_SYNC_ASYNCHRONOUS ((vm_sync_t) 0x01)
Expand Down
4 changes: 2 additions & 2 deletions lib/libc/include/any-macos-any/netinet/tcp.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ struct tcphdr {
#define TCPOPT_FASTOPEN 34
#define TCPOLEN_FASTOPEN_REQ 2

#define TCPOPT_ACCECN0 0xAC /* AccECN Order 0 */
#define TCPOPT_ACCECN1 0XAE /* AccECN Order 1 */
#define TCPOPT_ACCECN0 172 /* AccECN Order 0 */
#define TCPOPT_ACCECN1 174 /* AccECN Order 1 */
#define TCPOLEN_ACCECN_EMPTY 2 /* Empty option contains kind and length */
#define TCPOLEN_ACCECN_COUNTER 3 /* Length of each AccECN counter */

Expand Down
12 changes: 12 additions & 0 deletions lib/libc/include/any-macos-any/sys/_symbol_aliasing.h
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,12 @@
#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_18_1(x)
#endif

#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 180200
#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_18_2(x) x
#else
#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_18_2(x)
#endif

#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1000
#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_0(x) x
#else
Expand Down Expand Up @@ -905,3 +911,9 @@
#define __DARWIN_ALIAS_STARTING_MAC___MAC_15_1(x)
#endif

#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 150200
#define __DARWIN_ALIAS_STARTING_MAC___MAC_15_2(x) x
#else
#define __DARWIN_ALIAS_STARTING_MAC___MAC_15_2(x)
#endif

3 changes: 2 additions & 1 deletion lib/libc/include/any-macos-any/sys/attr.h
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,7 @@ typedef struct vol_attributes_attr {
#define ATTR_VOL_ENCODINGSUSED 0x00010000
#define ATTR_VOL_CAPABILITIES 0x00020000
#define ATTR_VOL_UUID 0x00040000
#define ATTR_VOL_MOUNTEXTFLAGS 0x00080000
#define ATTR_VOL_FSTYPENAME 0x00100000
#define ATTR_VOL_FSSUBTYPE 0x00200000
#define ATTR_VOL_SPACEUSED 0x00800000
Expand All @@ -496,7 +497,7 @@ typedef struct vol_attributes_attr {
#define ATTR_VOL_ATTRIBUTES 0x40000000
#define ATTR_VOL_INFO 0x80000000

#define ATTR_VOL_VALIDMASK 0xF0B7FFFF
#define ATTR_VOL_VALIDMASK 0xF0BFFFFF

/*
* The list of settable ATTR_VOL_* attributes include the following:
Expand Down
8 changes: 8 additions & 0 deletions lib/libc/include/any-macos-any/sys/mman.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,10 @@

/*
* msync() flags
*
* When making a new MS_*, update tests vm_parameter_validation_[user|kern]
* and their expected results; they deliberately call VM functions with invalid
* msync values and you may be turning one of those invalid msyncs valid.
*/
#define MS_ASYNC 0x0001 /* [MF|SIO] return immediately */
#define MS_INVALIDATE 0x0002 /* [MF|SIO] invalidate all cached data */
Expand All @@ -192,6 +196,10 @@

/*
* Advice to madvise
*
* When making a new MADV_*, update tests vm_parameter_validation_[user|kern]
* and their expected results; they deliberately call VM functions with invalid
* madvise values and you may be turning one of those invalid madvises valid.
*/
#define POSIX_MADV_NORMAL 0 /* [MC1] no further special treatment */
#define POSIX_MADV_RANDOM 1 /* [MC1] expect random page refs */
Expand Down