From: Apple Date: Tue, 26 Jan 2021 19:09:29 +0000 (+0000) Subject: libpthread-454.80.2.tar.gz X-Git-Tag: macos-112^0 X-Git-Url: https://git.saurik.com/apple/libpthread.git/commitdiff_plain/6dae708f6d1d8da31e18eea81e0b01a72b80603e libpthread-454.80.2.tar.gz --- diff --git a/include/pthread/pthread.h b/include/pthread/pthread.h index 5d52d71..ddf4ae9 100644 --- a/include/pthread/pthread.h +++ b/include/pthread/pthread.h @@ -557,11 +557,11 @@ __API_AVAILABLE(macos(10.4), ios(2.0)) void pthread_yield_np(void); __API_AVAILABLE(macos(10.16)) -__SPI_AVAILABLE(ios(14.0), tvos(14.0), watchos(7.0), bridgeos(5.0), driverkit(20.0)) +__API_UNAVAILABLE(ios, tvos, watchos, bridgeos, driverkit) void pthread_jit_write_protect_np(int enabled); __API_AVAILABLE(macos(10.16)) -__SPI_AVAILABLE(ios(14.0), tvos(14.0), watchos(7.0), bridgeos(5.0), driverkit(20.0)) +__API_UNAVAILABLE(ios, tvos, watchos, bridgeos, driverkit) int pthread_jit_write_protect_supported_np(void); /*! diff --git a/src/pthread.c b/src/pthread.c index 57ff8e9..39f3131 100644 --- a/src/pthread.c +++ b/src/pthread.c @@ -1152,6 +1152,8 @@ pthread_setname_np(const char *name) } +#if TARGET_OS_OSX + void pthread_jit_write_protect_np(int enable) { @@ -1171,6 +1173,8 @@ int pthread_jit_write_protect_supported_np() return os_thread_self_restrict_rwx_is_supported(); } +#endif // TARGET_OS_OSX + OS_ALWAYS_INLINE static inline void __pthread_add_thread(pthread_t t, mach_port_t self, bool from_mach_thread) diff --git a/tests/Makefile b/tests/Makefile index 1988e63..f898cf7 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -55,8 +55,11 @@ TARGETS += setrlimit_sigsegv TARGETS += wq_limits TARGETS += add_timer_termination TARGETS += perf_contended_mutex_rwlock + +ifeq ($(PLATFORM),MacOSX) TARGETS += pthread_jit_write_protection pthread_jit_write_protection: CODE_SIGN_ENTITLEMENTS=pthread_jit_write_protection-entitlements.plist +endif # this should be CUSTOM_TARGETS, see "Compatibility defines" in Makefile.targets OTHER_TARGETS := stackoverflow_crash diff --git a/tests/pthread_jit_write_protection.c b/tests/pthread_jit_write_protection.c index bb17876..f340119 100644 --- a/tests/pthread_jit_write_protection.c +++ b/tests/pthread_jit_write_protection.c @@ -17,6 +17,12 @@ #include #endif +#include + +#if !TARGET_OS_OSX +#error "These tests are only expected to run on macOS" +#endif // TARGET_OS_OSX + T_GLOBAL_META(T_META_RUN_CONCURRENTLY(true)); /* Enumerations */