exports_internal.h [plain text]
#ifndef __LIBPTHREAD_EXPORTS_INTERNAL_H__
#define __LIBPTHREAD_EXPORTS_INTERNAL_H__
#include <os/base.h>
#include <mach/mach.h>
#include <pthread.h>
struct ProgramVars;
OS_EXPORT int __is_threaded;
OS_EXPORT const int __unix_conforming;
OS_EXPORT
void
_pthread_set_self(pthread_t);
OS_EXPORT
pthread_t
_pthread_self(void);
OS_EXPORT
int
__pthread_init(const struct _libpthread_functions *pthread_funcs,
const char *envp[], const char *apple[],
const struct ProgramVars *vars);
OS_EXPORT OS_NORETURN
void
thread_start(pthread_t self, mach_port_t kport,
void *(*fun)(void *), void *arg,
size_t stacksize, unsigned int flags);
OS_EXPORT OS_NORETURN
void
_pthread_start(pthread_t thread, mach_port_t kport,
void *(*fun)(void *), void *arg,
size_t stacksize, unsigned int flags);
OS_EXPORT OS_NORETURN
void
start_wqthread(pthread_t self, mach_port_t kport,
void *stackaddr, void *unused, int reuse);
OS_EXPORT
void
_pthread_wqthread(pthread_t self, mach_port_t kport,
void *stackaddr, void *keventlist, int flags, int nkevents);
#if defined(__x86_64__) || defined(__i386__) || defined(__arm64__)
OS_EXPORT
void
___chkstk_darwin(void);
OS_EXPORT
void
thread_chkstk_darwin(void);
#endif // defined(__x86_64__) || defined(__i386__) || defined(__arm64__)
#pragma mark - exports with prototypes from not in libpthread
OS_EXPORT
int
sigwait(const sigset_t *, int *) __DARWIN_ALIAS_C(sigwait);
#pragma mark - shared with libsystem_kernel.dylib
OS_EXPORT
void
_pthread_clear_qos_tsd(mach_port_t kport);
OS_EXPORT
void
_pthread_exit_if_canceled(int error);
#pragma mark - atfork libSystem integration
OS_EXPORT void _pthread_atfork_prepare_handlers(void);
OS_EXPORT void _pthread_atfork_prepare(void);
OS_EXPORT void _pthread_atfork_parent(void);
OS_EXPORT void _pthread_atfork_parent_handlers(void);
OS_EXPORT void _pthread_atfork_child(void);
OS_EXPORT void _pthread_atfork_child_handlers(void);
OS_EXPORT void _pthread_fork_prepare(void);
OS_EXPORT void _pthread_fork_parent(void);
OS_EXPORT void _pthread_fork_child(void);
OS_EXPORT void _pthread_fork_child_postinit(void);
#pragma mark - TAPI
#ifdef __clang_tapi__
#define declare_symbol(s) OS_EXPORT void __tapi_##s(void) asm("_" #s)
#if TARGET_OS_OSX && defined(__i386__)
declare_symbol(pthread_cancel);
declare_symbol(pthread_cond_init);
declare_symbol(pthread_cond_timedwait);
declare_symbol(pthread_cond_wait);
declare_symbol(pthread_join);
declare_symbol(pthread_mutexattr_destroy);
declare_symbol(pthread_rwlock_destroy);
declare_symbol(pthread_rwlock_init);
declare_symbol(pthread_rwlock_rdlock);
declare_symbol(pthread_rwlock_tryrdlock);
declare_symbol(pthread_rwlock_trywrlock);
declare_symbol(pthread_rwlock_unlock);
declare_symbol(pthread_rwlock_wrlock);
declare_symbol(pthread_setcancelstate);
declare_symbol(pthread_setcanceltype);
declare_symbol(pthread_sigmask);
declare_symbol(pthread_testcancel);
declare_symbol(sigwait);
declare_symbol(pthread_cond_timedwait$UNIX2003);
declare_symbol(pthread_cond_wait$UNIX2003);
declare_symbol(pthread_join$UNIX2003);
declare_symbol(sigwait$UNIX2003);
#else
declare_symbol(pthread_cond_timedwait);
declare_symbol(pthread_cond_wait);
declare_symbol(pthread_join);
declare_symbol(sigwait);
#endif
#undef declare_symbol
#endif // __clang_tapi__
#endif // __LIBPTHREAD_EXPORTS_INTERNAL_H__