peachsim 0.1.1674 → 0.1.1684
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli/commands/control.ts +13 -1
- package/cli/commands/coverage-swift.ts +83 -27
- package/cli/commands/coverage.ts +219 -20
- package/cli/commands/detect.ts +10 -6
- package/cli/commands/inspect/core.ts +2 -0
- package/cli/commands/inspect/wait-ready.ts +7 -0
- package/cli/outbound-endpoints.ts +12 -0
- package/detox/index.ts +11 -1
- package/detox/jest-environment.cjs +14 -0
- package/dist-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/attached-projects.cjs +1 -1
- package/dist-lib/auth/shared-session.cjs +1 -1
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +1 -1
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/bridge-contract-input.cjs +1 -1
- package/dist-lib/bridge-contract-input.mjs +1 -1
- package/dist-lib/bridge-contract.cjs +1 -1
- package/dist-lib/bridge-contract.mjs +1 -1
- package/dist-lib/bundle-channel.cjs +3274 -1663
- package/dist-lib/capture-contract.cjs +1 -1
- package/dist-lib/capture-contract.mjs +1 -1
- package/dist-lib/cloud-contract.cjs +1 -1
- package/dist-lib/cloud-contract.mjs +1 -1
- package/dist-lib/cloud-test-args.cjs +1 -1
- package/dist-lib/cloud-test-args.mjs +1 -1
- package/dist-lib/cloud.cjs +1 -1
- package/dist-lib/cloud.mjs +1 -1
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/config.mjs +1 -1
- package/dist-lib/detox/index.cjs +6 -4
- package/dist-lib/detox/jest-environment.cjs +14 -0
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/expo-swift-bundle.cjs +2407 -1126
- package/dist-lib/expo-swift-metadata.cjs +1 -1
- package/dist-lib/expo-swift-metadata.mjs +1 -1
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +2879 -1598
- package/dist-lib/host/fetch-proxy-handler.cjs +18 -5
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
- package/dist-lib/host/replacement-module-handler.cjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +1904 -741
- package/dist-lib/jump-to-source-babel.cjs +1 -1
- package/dist-lib/jump-to-source-native.cjs +1 -1
- package/dist-lib/kotlin-host.cjs +1 -1
- package/dist-lib/menu.cjs +1 -1
- package/dist-lib/menu.mjs +1 -1
- package/dist-lib/metro-fingerprint-registry.cjs +1 -1
- package/dist-lib/metro-fingerprint-registry.mjs +1 -1
- package/dist-lib/metro-production-bundle.cjs +1 -1
- package/dist-lib/metro-production-bundle.mjs +1 -1
- package/dist-lib/metro.cjs +6215 -4283
- package/dist-lib/native-app-identity-project.cjs +31 -6
- package/dist-lib/native-app-identity-project.mjs +31 -6
- package/dist-lib/native-app-identity.cjs +1 -1
- package/dist-lib/native-app-identity.mjs +1 -1
- package/dist-lib/native-firebase-metadata.cjs +1 -1
- package/dist-lib/native-firebase-metadata.mjs +1 -1
- package/dist-lib/plist.cjs +1 -1
- package/dist-lib/plist.mjs +1 -1
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/public-brand.cjs +1 -1
- package/dist-lib/public-origins-lib-esm.json +24 -23
- package/dist-lib/public-origins-lib-static.json +1 -1
- package/dist-lib/public-origins-lib.json +134 -78
- package/dist-lib/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +1 -1
- package/dist-lib/reap-browser.cjs +2 -2
- package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
- package/dist-lib/sdk.cjs +2 -1
- package/dist-lib/sdk.mjs +2 -1
- package/dist-lib/skills.cjs +3570 -2160
- package/dist-lib/swift-compile.cjs +473 -351
- package/dist-lib/swift-compile.mjs +471 -349
- package/dist-lib/swift-package.cjs +36 -6
- package/dist-lib/swift-package.mjs +35 -6
- package/dist-lib/swift-submit.cjs +1 -1
- package/dist-lib/swift-submit.mjs +1 -1
- package/dist-lib/swift-toolchain.cjs +26 -11
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vite-swift.cjs +2418 -1132
- package/dist-lib/vite.cjs +1907 -766
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +1 -1
- package/dist-types/packages/peach-engine/src/engine/canvaskit-api.d.ts +1 -1
- package/dist-types/packages/peach-engine/src/engine/clipboardContract.d.ts +9 -1
- package/dist-types/packages/peach-engine/src/preview/upload-protocol.d.ts +11 -3
- package/dist-types/packages/peach-engine/src/webview-automation-host.d.ts +6 -0
- package/dist-types/packages/peach-globals/src/clipboardBridgeContract.d.ts +2 -0
- package/package.json +1 -1
- package/runtime-companion.json +1 -1
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h +51 -2
- package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h +21 -0
- package/sdk/ios/System/Library/Frameworks/MessageUI.framework/Headers/MFComposeAssistantViewController.h +29 -0
- package/sdk/ios/System/Library/Frameworks/MessageUI.framework/Headers/MFMailComposeControllerDeferredAction.h +14 -0
- package/sdk/ios/System/Library/Frameworks/MessageUI.framework/Headers/MFMailComposeViewController.h +162 -0
- package/sdk/ios/System/Library/Frameworks/MessageUI.framework/Headers/MFMailDraft.h +24 -0
- package/sdk/ios/System/Library/Frameworks/MessageUI.framework/Headers/MFMessageComposeViewController+UPI.h +31 -0
- package/sdk/ios/System/Library/Frameworks/MessageUI.framework/Headers/MFMessageComposeViewController.h +169 -0
- package/sdk/ios/System/Library/Frameworks/MessageUI.framework/Headers/MessageUI.h +13 -0
- package/sdk/ios/System/Library/Frameworks/MessageUI.framework/Modules/module.modulemap +11 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h +10 -0
- package/sdk/ios/usr/include/arm/param.h +151 -0
- package/sdk/ios/usr/include/dispatch/dispatch.h +3 -0
- package/sdk/ios/usr/include/dlfcn.h +1 -2
- package/sdk/ios/usr/include/machine/param.h +42 -0
- package/sdk/ios/usr/include/net/if.h +1 -2
- package/sdk/ios/usr/include/peach/pthread.h +4 -4
- package/sdk/ios/usr/include/pthread/qos.h +304 -0
- package/sdk/ios/usr/include/sys/_types/_fd_clr.h +31 -0
- package/sdk/ios/usr/include/sys/_types/_fd_copy.h +31 -0
- package/sdk/ios/usr/include/sys/_types/_fd_def.h +121 -0
- package/sdk/ios/usr/include/sys/_types/_fd_isset.h +31 -0
- package/sdk/ios/usr/include/sys/_types/_fd_set.h +31 -0
- package/sdk/ios/usr/include/sys/_types/_fd_setsize.h +31 -0
- package/sdk/ios/usr/include/sys/_types/_fd_zero.h +31 -0
- package/sdk/ios/usr/include/sys/cdefs.h +3 -0
- package/sdk/ios/usr/include/sys/param.h +235 -0
- package/sdk/ios/usr/include/sys/proc.h +1 -0
- package/sdk/ios/usr/include/sys/qos.h +151 -12
- package/sdk/ios/wasm/include/__typedef_sigset_t.h +7 -0
- package/sdk/ios/wasm/include/fcntl.h +11 -0
- package/sdk/ios/wasm/include/mach/machine/boolean.h +2 -0
- package/sdk/ios/wasm/include/mach/machine/exception.h +5 -0
- package/sdk/ios/wasm/include/mach/machine/kern_return.h +2 -0
- package/sdk/ios/wasm/include/mach/machine/processor_info.h +2 -0
- package/sdk/ios/wasm/include/mach/machine/rpc.h +2 -0
- package/sdk/ios/wasm/include/mach/machine/thread_state.h +3 -0
- package/sdk/ios/wasm/include/mach/machine/thread_status.h +3 -0
- package/sdk/ios/wasm/include/mach/machine/vm_param.h +3 -0
- package/sdk/ios/wasm/include/mach/machine/vm_types.h +18 -0
- package/sdk/ios/wasm/include/machine/_types.h +153 -0
- package/sdk/ios/wasm/include/machine/endian.h +2 -0
- package/sdk/ios/wasm/include/machine/limits.h +2 -0
- package/sdk/ios/wasm/include/machine/types.h +30 -0
- package/sdk/ios/wasm/include/poll.h +8 -0
- package/sdk/ios/wasm/include/pthread.h +50 -0
- package/sdk/ios/wasm/include/signal.h +72 -0
- package/sdk/ios/wasm/include/stdlib.h +3 -0
- package/sdk/ios/wasm/include/string.h +10 -0
- package/sdk/ios/wasm/include/sys/_pthread/_pthread_attr_t.h +7 -0
- package/sdk/ios/wasm/include/sys/_pthread/_pthread_t.h +7 -0
- package/sdk/ios/wasm/include/sys/mman.h +122 -0
- package/sdk/ios/wasm/include/sys/select.h +37 -0
- package/sdk/ios/wasm/include/sys/signal.h +259 -0
- package/sdk/ios/wasm/include/sys/socket.h +8 -0
- package/sdk/ios/wasm/include/sys/types.h +14 -0
- package/sdk/ios/wasm/include/sys/ucontext.h +1 -0
- package/sdk/ios/wasm/include/sys/uio.h +11 -0
- package/sdk/ios/wasm/include/sys/wait.h +89 -0
- package/sdk/ios/wasm/include/time.h +8 -0
- package/sdk/ios/wasm/include/unistd.h +17 -0
- package/src/bridge-contract.ts +2 -0
- package/src/chromium-admission.ts +10 -5
- package/src/device-catalog.ts +4 -4
- package/src/host/fetch-proxy-handler.ts +20 -0
- package/src/metro-plugin.ts +5 -2
- package/src/nitro-adapter.lock.json +6 -6
- package/src/nitro-compile.ts +63 -2
- package/src/numbered-lock.ts +72 -0
- package/src/react-native-coverage/capability-reference-resolution.ts +62 -5
- package/src/react-native-coverage/capability-source-references.ts +50 -13
- package/src/react-native-coverage/native-source-credit.ts +126 -0
- package/src/react-native-coverage/native-source-ranges-file.ts +38 -0
- package/src/react-native-coverage/native-surface.ts +49 -0
- package/src/react-native-coverage/verified-reach.ts +22 -2
- package/src/runtime-assets.ts +17 -0
- package/src/swift-compile.ts +84 -48
- package/src/swift-coverage/indexing.ts +17 -1
- package/src/swift-coverage/sdk.ts +71 -0
- package/src/swift-coverage/source.ts +74 -2
- package/src/swift-coverage/types.ts +6 -0
- package/src/swift-distribution.lock.json +12 -12
- package/src/swift-host.ts +133 -14
- package/src/swift-objc-compile.ts +6 -21
- package/src/swift-objc-metadata.ts +2 -8
- package/src/swift-objc-platform.ts +53 -0
- package/src/swift-objc-standin.ts +45 -1
- package/src/swift-package-manifest.ts +48 -3
- package/src/swift-package.ts +59 -9
- package/src/swift-packages.ts +157 -44
- package/src/swift-source-pods.ts +288 -0
- package/src/swift-toolchain.ts +32 -10
- package/src/vite-plugin-one.ts +5 -4
- package/src/worker-system-chunks.ts +7 -1
- package/src/xcode-project.ts +40 -11
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
// like arm/types.h, the fixed-width and pointer names come from darwin's own
|
|
3
|
+
// typedef headers over machine/_types.h, never the installed sys/types.h, which
|
|
4
|
+
// reaches fd_set before darwin's sys/_types/_fd_def.h defines it.
|
|
5
|
+
#include <machine/_types.h>
|
|
6
|
+
#include <sys/cdefs.h>
|
|
7
|
+
#include <sys/_types/_int8_t.h>
|
|
8
|
+
#include <sys/_types/_int16_t.h>
|
|
9
|
+
#include <sys/_types/_int32_t.h>
|
|
10
|
+
#include <sys/_types/_int64_t.h>
|
|
11
|
+
#include <sys/_types/_u_int8_t.h>
|
|
12
|
+
#include <sys/_types/_u_int16_t.h>
|
|
13
|
+
#include <sys/_types/_u_int32_t.h>
|
|
14
|
+
#include <sys/_types/_u_int64_t.h>
|
|
15
|
+
// the installed libc's register width.
|
|
16
|
+
typedef long long register_t;
|
|
17
|
+
#include <sys/_types/_intptr_t.h>
|
|
18
|
+
#include <sys/_types/_uintptr_t.h>
|
|
19
|
+
#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
|
|
20
|
+
typedef uintptr_t user_addr_t;
|
|
21
|
+
typedef uintptr_t user_size_t;
|
|
22
|
+
typedef intptr_t user_ssize_t;
|
|
23
|
+
typedef long user_long_t;
|
|
24
|
+
typedef unsigned long user_ulong_t;
|
|
25
|
+
typedef int64_t user_time_t;
|
|
26
|
+
typedef int64_t user_off_t;
|
|
27
|
+
#define USER_ADDR_NULL ((user_addr_t) 0)
|
|
28
|
+
#define CAST_USER_ADDR_T(a_ptr) ((user_addr_t)((uintptr_t)(a_ptr)))
|
|
29
|
+
#endif
|
|
30
|
+
typedef uintptr_t syscall_arg_t;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
// darwin's cancellation points bind to the darwin provider, which acts on a
|
|
3
|
+
// pending cancel first.
|
|
4
|
+
#include_next <poll.h>
|
|
5
|
+
#include <sys/cdefs.h>
|
|
6
|
+
__BEGIN_DECLS
|
|
7
|
+
int poll(struct pollfd *, nfds_t, int) __asm__("__peach_darwin_poll");
|
|
8
|
+
__END_DECLS
|
|
@@ -1,3 +1,53 @@
|
|
|
1
1
|
#pragma once
|
|
2
|
+
// darwin's pthread_setname_np names only the calling thread; the installed
|
|
3
|
+
// libc's gnu declaration takes a thread too.
|
|
4
|
+
#define pthread_setname_np __peach_gnu_pthread_setname_np
|
|
2
5
|
#include_next <pthread.h>
|
|
6
|
+
#undef pthread_setname_np
|
|
7
|
+
#include <sys/_pthread/_pthread_types.h>
|
|
3
8
|
#include <peach/pthread.h>
|
|
9
|
+
#include <pthread/qos.h>
|
|
10
|
+
|
|
11
|
+
// darwin numbers its cancel states and types its own way, keeps cleanup
|
|
12
|
+
// handlers in its own record, and acts on a pending cancel at the calls it
|
|
13
|
+
// marks as cancellation points; these bind to the darwin provider.
|
|
14
|
+
#undef PTHREAD_CANCEL_ENABLE
|
|
15
|
+
#undef PTHREAD_CANCEL_DISABLE
|
|
16
|
+
#undef PTHREAD_CANCEL_MASKED
|
|
17
|
+
#undef PTHREAD_CANCEL_DEFERRED
|
|
18
|
+
#undef PTHREAD_CANCEL_ASYNCHRONOUS
|
|
19
|
+
#undef PTHREAD_CANCELED
|
|
20
|
+
#undef pthread_cleanup_push
|
|
21
|
+
#undef pthread_cleanup_pop
|
|
22
|
+
#define PTHREAD_CANCEL_ENABLE 0x01 /* Cancel takes place at next cancellation point */
|
|
23
|
+
#define PTHREAD_CANCEL_DISABLE 0x00 /* Cancel postponed */
|
|
24
|
+
#define PTHREAD_CANCEL_DEFERRED 0x02 /* Cancel waits until cancellation point */
|
|
25
|
+
#define PTHREAD_CANCEL_ASYNCHRONOUS 0x00 /* Cancel occurs immediately */
|
|
26
|
+
#define PTHREAD_CANCELED ((void *) 1)
|
|
27
|
+
|
|
28
|
+
__BEGIN_DECLS
|
|
29
|
+
struct __darwin_pthread_handler_rec **__peach_darwin_cleanup_stack(void);
|
|
30
|
+
int pthread_cancel(pthread_t) __asm__("__peach_darwin_pthread_cancel");
|
|
31
|
+
int pthread_setcancelstate(int , int * _Nullable) __asm__("__peach_darwin_pthread_setcancelstate");
|
|
32
|
+
int pthread_setcanceltype(int , int * _Nullable) __asm__("__peach_darwin_pthread_setcanceltype");
|
|
33
|
+
void pthread_testcancel(void) __asm__("__peach_darwin_pthread_testcancel");
|
|
34
|
+
int pthread_join(pthread_t, void **) __asm__("__peach_darwin_pthread_join");
|
|
35
|
+
int pthread_cond_wait(pthread_cond_t *__restrict, pthread_mutex_t *__restrict) __asm__("__peach_darwin_pthread_cond_wait");
|
|
36
|
+
int pthread_cond_timedwait(pthread_cond_t *__restrict, pthread_mutex_t *__restrict, const struct timespec *__restrict)
|
|
37
|
+
__asm__("__peach_darwin_pthread_cond_timedwait");
|
|
38
|
+
__END_DECLS
|
|
39
|
+
|
|
40
|
+
#define pthread_cleanup_push(func, val) \
|
|
41
|
+
{ \
|
|
42
|
+
struct __darwin_pthread_handler_rec __handler; \
|
|
43
|
+
struct __darwin_pthread_handler_rec **__stack = __peach_darwin_cleanup_stack(); \
|
|
44
|
+
__handler.__routine = func; \
|
|
45
|
+
__handler.__arg = val; \
|
|
46
|
+
__handler.__next = *__stack; \
|
|
47
|
+
*__stack = &__handler;
|
|
48
|
+
|
|
49
|
+
#define pthread_cleanup_pop(execute) \
|
|
50
|
+
/* Note: 'handler' must be in this same lexical context! */ \
|
|
51
|
+
*__stack = __handler.__next; \
|
|
52
|
+
if (execute) (__handler.__routine)(__handler.__arg); \
|
|
53
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
// darwin's signal.h in place of the installed libc's. functions the installed
|
|
2
|
+
// libc also defines with its own numbering (raise, bsd_signal, psignal) have
|
|
3
|
+
// their own symbols. waiting for a signal needs asynchronous delivery, which
|
|
4
|
+
// a wasm instance has no source of.
|
|
5
|
+
#ifndef _USER_SIGNAL_H
|
|
6
|
+
#define _USER_SIGNAL_H
|
|
7
|
+
|
|
8
|
+
#include <sys/cdefs.h>
|
|
9
|
+
#include <sys/signal.h>
|
|
10
|
+
#include <peach/darwin.h>
|
|
11
|
+
#define __NEED_pthread_t
|
|
12
|
+
#include <bits/alltypes.h>
|
|
13
|
+
|
|
14
|
+
#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
|
|
15
|
+
extern __const char *__const sys_signame[NSIG];
|
|
16
|
+
extern __const char *__const sys_siglist[NSIG];
|
|
17
|
+
#endif
|
|
18
|
+
|
|
19
|
+
__BEGIN_DECLS
|
|
20
|
+
int raise(int) __asm__("__peach_darwin_raise");
|
|
21
|
+
__END_DECLS
|
|
22
|
+
|
|
23
|
+
#ifndef _ANSI_SOURCE
|
|
24
|
+
__BEGIN_DECLS
|
|
25
|
+
void (* _Nullable bsd_signal(int, void (* _Nullable)(int)))(int) __asm__("__peach_darwin_bsd_signal");
|
|
26
|
+
int kill(pid_t, int);
|
|
27
|
+
int killpg(pid_t, int);
|
|
28
|
+
int pthread_kill(pthread_t, int);
|
|
29
|
+
int pthread_sigmask(int, const sigset_t *, sigset_t *);
|
|
30
|
+
int sigaction(int, const struct sigaction * __restrict, struct sigaction * __restrict);
|
|
31
|
+
int sigaddset(sigset_t *, int);
|
|
32
|
+
int sigaltstack(const stack_t * __restrict, stack_t * __restrict);
|
|
33
|
+
int sigdelset(sigset_t *, int);
|
|
34
|
+
int sigemptyset(sigset_t *);
|
|
35
|
+
int sigfillset(sigset_t *);
|
|
36
|
+
int sighold(int);
|
|
37
|
+
int sigignore(int);
|
|
38
|
+
int siginterrupt(int, int);
|
|
39
|
+
int sigismember(const sigset_t *, int);
|
|
40
|
+
int sigpause(int) __PEACH_DARWIN_UNAVAILABLE("Darwin asynchronous signals are not implemented for WebAssembly");
|
|
41
|
+
int sigpending(sigset_t *);
|
|
42
|
+
int sigprocmask(int, const sigset_t * __restrict, sigset_t * __restrict);
|
|
43
|
+
int sigrelse(int);
|
|
44
|
+
void (* _Nullable sigset(int, void (* _Nullable)(int)))(int);
|
|
45
|
+
int sigsuspend(const sigset_t *) __PEACH_DARWIN_UNAVAILABLE("Darwin asynchronous signals are not implemented for WebAssembly");
|
|
46
|
+
int sigwait(const sigset_t * __restrict, int * __restrict) __PEACH_DARWIN_UNAVAILABLE("Darwin asynchronous signals are not implemented for WebAssembly");
|
|
47
|
+
#if !defined(_POSIX_C_SOURCE) || _POSIX_C_SOURCE >= 200809L || defined(_DARWIN_C_SOURCE)
|
|
48
|
+
void psignal(int, const char *) __asm__("__peach_darwin_psignal");
|
|
49
|
+
#endif
|
|
50
|
+
#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
|
|
51
|
+
int sigblock(int);
|
|
52
|
+
int sigsetmask(int);
|
|
53
|
+
int sigvec(int, struct sigvec *, struct sigvec *);
|
|
54
|
+
#endif
|
|
55
|
+
__END_DECLS
|
|
56
|
+
|
|
57
|
+
__header_always_inline unsigned int
|
|
58
|
+
__sigbits(int __signo)
|
|
59
|
+
{
|
|
60
|
+
if (__signo == 0 || __signo > __DARWIN_NSIG)
|
|
61
|
+
return (0);
|
|
62
|
+
return (1U << (__signo - 1));
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
#define sigaddset(set, signo) (*(set) |= __sigbits(signo), 0)
|
|
66
|
+
#define sigdelset(set, signo) (*(set) &= ~__sigbits(signo), 0)
|
|
67
|
+
#define sigismember(set, signo) ((*(set) & __sigbits(signo)) != 0)
|
|
68
|
+
#define sigemptyset(set) (*(set) = 0, 0)
|
|
69
|
+
#define sigfillset(set) (*(set) = ~(sigset_t)0, 0)
|
|
70
|
+
#endif
|
|
71
|
+
|
|
72
|
+
#endif
|
|
@@ -1,3 +1,13 @@
|
|
|
1
1
|
#pragma once
|
|
2
|
+
// the installed libc's strsignal keeps its own numbering, so darwin's has its
|
|
3
|
+
// own symbol.
|
|
4
|
+
#define strsignal __peach_darwin_strsignal
|
|
2
5
|
#include_next <string.h>
|
|
6
|
+
#undef strsignal
|
|
3
7
|
#include <sys/cdefs.h>
|
|
8
|
+
__BEGIN_DECLS
|
|
9
|
+
char *strsignal(int __sig) __asm__("__peach_darwin_strsignal");
|
|
10
|
+
#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
|
|
11
|
+
char *strnstr(const char *__big, const char *__little, size_t __len);
|
|
12
|
+
#endif
|
|
13
|
+
__END_DECLS
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
// darwin's sys/mman.h over the installed libc: darwin's protections, flags
|
|
2
|
+
// and advice values, with libc's mode_t, off_t and size_t storage. the mapping
|
|
3
|
+
// calls the installed libc also defines with its own numbering have their own
|
|
4
|
+
// symbols; memory locking, advice and shared memory objects have no wasm
|
|
5
|
+
// provider.
|
|
6
|
+
#ifndef _SYS_MMAN_H_
|
|
7
|
+
#define _SYS_MMAN_H_
|
|
8
|
+
|
|
9
|
+
#include <sys/cdefs.h>
|
|
10
|
+
#include <sys/appleapiopts.h>
|
|
11
|
+
#include <Availability.h>
|
|
12
|
+
#include <peach/darwin.h>
|
|
13
|
+
#define __NEED_mode_t
|
|
14
|
+
#define __NEED_off_t
|
|
15
|
+
#define __NEED_size_t
|
|
16
|
+
#include <bits/alltypes.h>
|
|
17
|
+
|
|
18
|
+
#define PROT_NONE 0x00
|
|
19
|
+
#define PROT_READ 0x01
|
|
20
|
+
#define PROT_WRITE 0x02
|
|
21
|
+
#define PROT_EXEC 0x04
|
|
22
|
+
|
|
23
|
+
#define MAP_SHARED 0x0001
|
|
24
|
+
#define MAP_PRIVATE 0x0002
|
|
25
|
+
#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
|
|
26
|
+
#define MAP_COPY MAP_PRIVATE
|
|
27
|
+
#endif
|
|
28
|
+
|
|
29
|
+
#define MAP_FIXED 0x0010
|
|
30
|
+
#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
|
|
31
|
+
#define MAP_RENAME 0x0020
|
|
32
|
+
#define MAP_NORESERVE 0x0040
|
|
33
|
+
#define MAP_RESERVED0080 0x0080
|
|
34
|
+
#define MAP_NOEXTEND 0x0100
|
|
35
|
+
#define MAP_HASSEMAPHORE 0x0200
|
|
36
|
+
#define MAP_NOCACHE 0x0400
|
|
37
|
+
#define MAP_JIT 0x0800
|
|
38
|
+
|
|
39
|
+
#define MAP_FILE 0x0000
|
|
40
|
+
#define MAP_ANON 0x1000
|
|
41
|
+
#define MAP_ANONYMOUS MAP_ANON
|
|
42
|
+
|
|
43
|
+
#define MAP_RESILIENT_CODESIGN 0x2000
|
|
44
|
+
#define MAP_RESILIENT_MEDIA 0x4000
|
|
45
|
+
|
|
46
|
+
#define MAP_TRANSLATED_ALLOW_EXECUTE 0x20000
|
|
47
|
+
|
|
48
|
+
#define MAP_UNIX03 0x40000
|
|
49
|
+
|
|
50
|
+
#define MAP_TPRO 0x80000
|
|
51
|
+
#endif
|
|
52
|
+
|
|
53
|
+
#define MCL_CURRENT 0x0001
|
|
54
|
+
#define MCL_FUTURE 0x0002
|
|
55
|
+
|
|
56
|
+
#define MAP_FAILED ((void *)-1)
|
|
57
|
+
|
|
58
|
+
#define MS_ASYNC 0x0001
|
|
59
|
+
#define MS_INVALIDATE 0x0002
|
|
60
|
+
#define MS_SYNC 0x0010
|
|
61
|
+
|
|
62
|
+
#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
|
|
63
|
+
#define MS_KILLPAGES 0x0004
|
|
64
|
+
#define MS_DEACTIVATE 0x0008
|
|
65
|
+
#endif
|
|
66
|
+
|
|
67
|
+
#define POSIX_MADV_NORMAL 0
|
|
68
|
+
#define POSIX_MADV_RANDOM 1
|
|
69
|
+
#define POSIX_MADV_SEQUENTIAL 2
|
|
70
|
+
#define POSIX_MADV_WILLNEED 3
|
|
71
|
+
#define POSIX_MADV_DONTNEED 4
|
|
72
|
+
|
|
73
|
+
#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
|
|
74
|
+
#define MADV_NORMAL POSIX_MADV_NORMAL
|
|
75
|
+
#define MADV_RANDOM POSIX_MADV_RANDOM
|
|
76
|
+
#define MADV_SEQUENTIAL POSIX_MADV_SEQUENTIAL
|
|
77
|
+
#define MADV_WILLNEED POSIX_MADV_WILLNEED
|
|
78
|
+
#define MADV_DONTNEED POSIX_MADV_DONTNEED
|
|
79
|
+
#define MADV_FREE 5
|
|
80
|
+
#define MADV_ZERO_WIRED_PAGES 6
|
|
81
|
+
#define MADV_FREE_REUSABLE 7
|
|
82
|
+
#define MADV_FREE_REUSE 8
|
|
83
|
+
#define MADV_CAN_REUSE 9
|
|
84
|
+
#define MADV_PAGEOUT 10
|
|
85
|
+
#define MADV_ZERO 11
|
|
86
|
+
|
|
87
|
+
#define MINCORE_INCORE 0x1
|
|
88
|
+
#define MINCORE_REFERENCED 0x2
|
|
89
|
+
#define MINCORE_MODIFIED 0x4
|
|
90
|
+
#define MINCORE_REFERENCED_OTHER 0x8
|
|
91
|
+
#define MINCORE_MODIFIED_OTHER 0x10
|
|
92
|
+
#define MINCORE_PAGED_OUT 0x20
|
|
93
|
+
#define MINCORE_COPIED 0x40
|
|
94
|
+
#define MINCORE_ANONYMOUS 0x80
|
|
95
|
+
#endif
|
|
96
|
+
|
|
97
|
+
#define __PEACH_DARWIN_MMAN_UNAVAILABLE __PEACH_DARWIN_UNAVAILABLE("Darwin memory locking, advice and shared memory objects are not implemented for WebAssembly")
|
|
98
|
+
|
|
99
|
+
__BEGIN_DECLS
|
|
100
|
+
int mlockall(int) __PEACH_DARWIN_MMAN_UNAVAILABLE;
|
|
101
|
+
int munlockall(void) __PEACH_DARWIN_MMAN_UNAVAILABLE;
|
|
102
|
+
int mlock(const void *, size_t) __PEACH_DARWIN_MMAN_UNAVAILABLE;
|
|
103
|
+
#ifndef _MMAP
|
|
104
|
+
#define _MMAP
|
|
105
|
+
void *mmap(void *, size_t, int, int, int, off_t) __asm__("__peach_darwin_mmap");
|
|
106
|
+
#endif
|
|
107
|
+
int mprotect(void *, size_t, int) __asm__("__peach_darwin_mprotect");
|
|
108
|
+
int msync(void *, size_t, int) __asm__("__peach_darwin_msync");
|
|
109
|
+
int munlock(const void *, size_t) __PEACH_DARWIN_MMAN_UNAVAILABLE;
|
|
110
|
+
int munmap(void *, size_t) __asm__("__peach_darwin_munmap");
|
|
111
|
+
int shm_open(const char *, int, ...) __PEACH_DARWIN_MMAN_UNAVAILABLE;
|
|
112
|
+
int shm_unlink(const char *) __PEACH_DARWIN_MMAN_UNAVAILABLE;
|
|
113
|
+
int posix_madvise(void *, size_t, int) __PEACH_DARWIN_MMAN_UNAVAILABLE;
|
|
114
|
+
|
|
115
|
+
#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
|
|
116
|
+
int madvise(void *, size_t, int) __PEACH_DARWIN_MMAN_UNAVAILABLE;
|
|
117
|
+
int mincore(const void *, size_t, char *) __PEACH_DARWIN_MMAN_UNAVAILABLE;
|
|
118
|
+
int minherit(void *, size_t, int) __PEACH_DARWIN_MMAN_UNAVAILABLE;
|
|
119
|
+
#endif
|
|
120
|
+
__END_DECLS
|
|
121
|
+
|
|
122
|
+
#endif
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
// darwin's sys/select.h in place of the installed libc's, whose fd_set is a
|
|
3
|
+
// list of descriptors. fd_set is darwin's bitset (sys/_types/_fd_def.h) with
|
|
4
|
+
// darwin's FD_* macros and overflow check; the installed libc gives the time
|
|
5
|
+
// types and the overlay's sigset_t. sys/types.h comes first because the
|
|
6
|
+
// installed libc's sys/types.h reaches this header and darwin's fd_set is
|
|
7
|
+
// complete only after it. select and pselect bind to the darwin provider, which
|
|
8
|
+
// acts on a pending cancel and translates the sets to the installed libc's
|
|
9
|
+
// lists; _DARWIN_C_SOURCE and _DARWIN_UNLIMITED_SELECT select darwin's variant
|
|
10
|
+
// without the FD_SETSIZE limit, as they select select$DARWIN_EXTSN on ios.
|
|
11
|
+
#include <sys/cdefs.h>
|
|
12
|
+
#include <sys/types.h>
|
|
13
|
+
#include <sys/_types/_fd_def.h>
|
|
14
|
+
#include <__struct_timespec.h>
|
|
15
|
+
#include <__struct_timeval.h>
|
|
16
|
+
#include <__typedef_sigset_t.h>
|
|
17
|
+
#include <sys/_types/_fd_setsize.h>
|
|
18
|
+
#include <sys/_types/_fd_set.h>
|
|
19
|
+
#include <sys/_types/_fd_clr.h>
|
|
20
|
+
#include <sys/_types/_fd_isset.h>
|
|
21
|
+
#include <sys/_types/_fd_zero.h>
|
|
22
|
+
#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
|
|
23
|
+
#include <sys/_types/_fd_copy.h>
|
|
24
|
+
#endif
|
|
25
|
+
__BEGIN_DECLS
|
|
26
|
+
#if defined(_DARWIN_C_SOURCE) || defined(_DARWIN_UNLIMITED_SELECT)
|
|
27
|
+
int select(int, fd_set *__restrict, fd_set *__restrict, fd_set *__restrict, struct timeval *__restrict)
|
|
28
|
+
__asm__("__peach_darwin_select_extsn");
|
|
29
|
+
int pselect(int, fd_set *__restrict, fd_set *__restrict, fd_set *__restrict, const struct timespec *__restrict,
|
|
30
|
+
const sigset_t *__restrict) __asm__("__peach_darwin_pselect_extsn");
|
|
31
|
+
#else
|
|
32
|
+
int select(int, fd_set *__restrict, fd_set *__restrict, fd_set *__restrict, struct timeval *__restrict)
|
|
33
|
+
__asm__("__peach_darwin_select");
|
|
34
|
+
int pselect(int, fd_set *__restrict, fd_set *__restrict, fd_set *__restrict, const struct timespec *__restrict,
|
|
35
|
+
const sigset_t *__restrict) __asm__("__peach_darwin_pselect");
|
|
36
|
+
#endif
|
|
37
|
+
__END_DECLS
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
// darwin's sys/signal.h over the installed libc: darwin's numbers, records,
|
|
2
|
+
// codes and flags, with libc's pid_t, uid_t, size_t and pthread_attr_t
|
|
3
|
+
// storage. the ignore, error and hold dispositions are functions, as the
|
|
4
|
+
// installed libc spells them, because a wasm function pointer of 1, 5 or -1
|
|
5
|
+
// can name a real handler.
|
|
6
|
+
#ifndef _SYS_SIGNAL_H_
|
|
7
|
+
#define _SYS_SIGNAL_H_
|
|
8
|
+
|
|
9
|
+
#include <sys/cdefs.h>
|
|
10
|
+
#include <sys/appleapiopts.h>
|
|
11
|
+
#include <Availability.h>
|
|
12
|
+
|
|
13
|
+
#define __DARWIN_NSIG 32
|
|
14
|
+
|
|
15
|
+
#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
|
|
16
|
+
#define NSIG __DARWIN_NSIG
|
|
17
|
+
#endif
|
|
18
|
+
|
|
19
|
+
// machine/signal.h
|
|
20
|
+
typedef int sig_atomic_t;
|
|
21
|
+
|
|
22
|
+
#define SIGHUP 1
|
|
23
|
+
#define SIGINT 2
|
|
24
|
+
#define SIGQUIT 3
|
|
25
|
+
#define SIGILL 4
|
|
26
|
+
#define SIGTRAP 5
|
|
27
|
+
#define SIGABRT 6
|
|
28
|
+
#if (defined(_POSIX_C_SOURCE) && !defined(_DARWIN_C_SOURCE))
|
|
29
|
+
#define SIGPOLL 7
|
|
30
|
+
#else
|
|
31
|
+
#define SIGIOT SIGABRT
|
|
32
|
+
#define SIGEMT 7
|
|
33
|
+
#endif
|
|
34
|
+
#define SIGFPE 8
|
|
35
|
+
#define SIGKILL 9
|
|
36
|
+
#define SIGBUS 10
|
|
37
|
+
#define SIGSEGV 11
|
|
38
|
+
#define SIGSYS 12
|
|
39
|
+
#define SIGPIPE 13
|
|
40
|
+
#define SIGALRM 14
|
|
41
|
+
#define SIGTERM 15
|
|
42
|
+
#define SIGURG 16
|
|
43
|
+
#define SIGSTOP 17
|
|
44
|
+
#define SIGTSTP 18
|
|
45
|
+
#define SIGCONT 19
|
|
46
|
+
#define SIGCHLD 20
|
|
47
|
+
#define SIGTTIN 21
|
|
48
|
+
#define SIGTTOU 22
|
|
49
|
+
#if (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
|
|
50
|
+
#define SIGIO 23
|
|
51
|
+
#endif
|
|
52
|
+
#define SIGXCPU 24
|
|
53
|
+
#define SIGXFSZ 25
|
|
54
|
+
#define SIGVTALRM 26
|
|
55
|
+
#define SIGPROF 27
|
|
56
|
+
#if (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
|
|
57
|
+
#define SIGWINCH 28
|
|
58
|
+
#define SIGINFO 29
|
|
59
|
+
#endif
|
|
60
|
+
#define SIGUSR1 30
|
|
61
|
+
#define SIGUSR2 31
|
|
62
|
+
|
|
63
|
+
__BEGIN_DECLS
|
|
64
|
+
void __SIG_IGN(int);
|
|
65
|
+
void __SIG_ERR(int);
|
|
66
|
+
void __peach_darwin_sig_hold(int);
|
|
67
|
+
__END_DECLS
|
|
68
|
+
#define SIG_DFL ((void (*)(int))0)
|
|
69
|
+
#define SIG_IGN (__SIG_IGN)
|
|
70
|
+
#define SIG_HOLD (__peach_darwin_sig_hold)
|
|
71
|
+
#define SIG_ERR (__SIG_ERR)
|
|
72
|
+
|
|
73
|
+
#ifndef _ANSI_SOURCE
|
|
74
|
+
#define __NEED_pid_t
|
|
75
|
+
#define __NEED_uid_t
|
|
76
|
+
#define __NEED_size_t
|
|
77
|
+
#define __NEED_pthread_attr_t
|
|
78
|
+
#define __NEED_sigset_t
|
|
79
|
+
#include <bits/alltypes.h>
|
|
80
|
+
#include <sys/ucontext.h>
|
|
81
|
+
|
|
82
|
+
union sigval {
|
|
83
|
+
int sival_int;
|
|
84
|
+
void *sival_ptr;
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
#define SIGEV_NONE 0
|
|
88
|
+
#define SIGEV_SIGNAL 1
|
|
89
|
+
#define SIGEV_THREAD 3
|
|
90
|
+
#if (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
|
|
91
|
+
#define SIGEV_KEVENT 4
|
|
92
|
+
#endif
|
|
93
|
+
|
|
94
|
+
struct sigevent {
|
|
95
|
+
int sigev_notify;
|
|
96
|
+
int sigev_signo;
|
|
97
|
+
union sigval sigev_value;
|
|
98
|
+
void (*sigev_notify_function)(union sigval);
|
|
99
|
+
pthread_attr_t *sigev_notify_attributes;
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
typedef struct __siginfo {
|
|
103
|
+
int si_signo;
|
|
104
|
+
int si_errno;
|
|
105
|
+
int si_code;
|
|
106
|
+
pid_t si_pid;
|
|
107
|
+
uid_t si_uid;
|
|
108
|
+
int si_status;
|
|
109
|
+
void *si_addr;
|
|
110
|
+
union sigval si_value;
|
|
111
|
+
long si_band;
|
|
112
|
+
unsigned long __pad[7];
|
|
113
|
+
} siginfo_t;
|
|
114
|
+
|
|
115
|
+
#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
|
|
116
|
+
#define ILL_NOOP 0
|
|
117
|
+
#endif
|
|
118
|
+
#define ILL_ILLOPC 1
|
|
119
|
+
#define ILL_ILLTRP 2
|
|
120
|
+
#define ILL_PRVOPC 3
|
|
121
|
+
#define ILL_ILLOPN 4
|
|
122
|
+
#define ILL_ILLADR 5
|
|
123
|
+
#define ILL_PRVREG 6
|
|
124
|
+
#define ILL_COPROC 7
|
|
125
|
+
#define ILL_BADSTK 8
|
|
126
|
+
|
|
127
|
+
#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
|
|
128
|
+
#define FPE_NOOP 0
|
|
129
|
+
#endif
|
|
130
|
+
#define FPE_FLTDIV 1
|
|
131
|
+
#define FPE_FLTOVF 2
|
|
132
|
+
#define FPE_FLTUND 3
|
|
133
|
+
#define FPE_FLTRES 4
|
|
134
|
+
#define FPE_FLTINV 5
|
|
135
|
+
#define FPE_FLTSUB 6
|
|
136
|
+
#define FPE_INTDIV 7
|
|
137
|
+
#define FPE_INTOVF 8
|
|
138
|
+
|
|
139
|
+
#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
|
|
140
|
+
#define SEGV_NOOP 0
|
|
141
|
+
#endif
|
|
142
|
+
#define SEGV_MAPERR 1
|
|
143
|
+
#define SEGV_ACCERR 2
|
|
144
|
+
|
|
145
|
+
#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
|
|
146
|
+
#define BUS_NOOP 0
|
|
147
|
+
#endif
|
|
148
|
+
#define BUS_ADRALN 1
|
|
149
|
+
#define BUS_ADRERR 2
|
|
150
|
+
#define BUS_OBJERR 3
|
|
151
|
+
|
|
152
|
+
#define TRAP_BRKPT 1
|
|
153
|
+
#define TRAP_TRACE 2
|
|
154
|
+
|
|
155
|
+
#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
|
|
156
|
+
#define CLD_NOOP 0
|
|
157
|
+
#endif
|
|
158
|
+
#define CLD_EXITED 1
|
|
159
|
+
#define CLD_KILLED 2
|
|
160
|
+
#define CLD_DUMPED 3
|
|
161
|
+
#define CLD_TRAPPED 4
|
|
162
|
+
#define CLD_STOPPED 5
|
|
163
|
+
#define CLD_CONTINUED 6
|
|
164
|
+
|
|
165
|
+
#define POLL_IN 1
|
|
166
|
+
#define POLL_OUT 2
|
|
167
|
+
#define POLL_MSG 3
|
|
168
|
+
#define POLL_ERR 4
|
|
169
|
+
#define POLL_PRI 5
|
|
170
|
+
#define POLL_HUP 6
|
|
171
|
+
|
|
172
|
+
union __sigaction_u {
|
|
173
|
+
void (*__sa_handler)(int);
|
|
174
|
+
void (*__sa_sigaction)(int, struct __siginfo *, void *);
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
struct __sigaction {
|
|
178
|
+
union __sigaction_u __sigaction_u;
|
|
179
|
+
void (*sa_tramp)(void *, int, int, siginfo_t *, void *);
|
|
180
|
+
sigset_t sa_mask;
|
|
181
|
+
int sa_flags;
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
struct sigaction {
|
|
185
|
+
union __sigaction_u __sigaction_u;
|
|
186
|
+
sigset_t sa_mask;
|
|
187
|
+
int sa_flags;
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
#define sa_handler __sigaction_u.__sa_handler
|
|
191
|
+
#define sa_sigaction __sigaction_u.__sa_sigaction
|
|
192
|
+
|
|
193
|
+
#define SA_ONSTACK 0x0001
|
|
194
|
+
#define SA_RESTART 0x0002
|
|
195
|
+
#define SA_RESETHAND 0x0004
|
|
196
|
+
#define SA_NOCLDSTOP 0x0008
|
|
197
|
+
#define SA_NODEFER 0x0010
|
|
198
|
+
#define SA_NOCLDWAIT 0x0020
|
|
199
|
+
#define SA_SIGINFO 0x0040
|
|
200
|
+
#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
|
|
201
|
+
#define SA_USERTRAMP 0x0100
|
|
202
|
+
#define SA_64REGSET 0x0200
|
|
203
|
+
#endif
|
|
204
|
+
#define SA_USERSPACE_MASK (SA_ONSTACK | SA_RESTART | SA_RESETHAND | SA_NOCLDSTOP | SA_NODEFER | SA_NOCLDWAIT | SA_SIGINFO)
|
|
205
|
+
|
|
206
|
+
#define SIG_BLOCK 1
|
|
207
|
+
#define SIG_UNBLOCK 2
|
|
208
|
+
#define SIG_SETMASK 3
|
|
209
|
+
|
|
210
|
+
#define SI_USER 0x10001
|
|
211
|
+
#define SI_QUEUE 0x10002
|
|
212
|
+
#define SI_TIMER 0x10003
|
|
213
|
+
#define SI_ASYNCIO 0x10004
|
|
214
|
+
#define SI_MESGQ 0x10005
|
|
215
|
+
|
|
216
|
+
#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
|
|
217
|
+
typedef void (*sig_t)(int);
|
|
218
|
+
#endif
|
|
219
|
+
|
|
220
|
+
#define SS_ONSTACK 0x0001
|
|
221
|
+
#define SS_DISABLE 0x0004
|
|
222
|
+
#define MINSIGSTKSZ 32768
|
|
223
|
+
#define SIGSTKSZ 131072
|
|
224
|
+
|
|
225
|
+
#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
|
|
226
|
+
struct sigvec {
|
|
227
|
+
void (*sv_handler)(int);
|
|
228
|
+
int sv_mask;
|
|
229
|
+
int sv_flags;
|
|
230
|
+
};
|
|
231
|
+
|
|
232
|
+
#define SV_ONSTACK SA_ONSTACK
|
|
233
|
+
#define SV_INTERRUPT SA_RESTART
|
|
234
|
+
#define SV_RESETHAND SA_RESETHAND
|
|
235
|
+
#define SV_NODEFER SA_NODEFER
|
|
236
|
+
#define SV_NOCLDSTOP SA_NOCLDSTOP
|
|
237
|
+
#define SV_SIGINFO SA_SIGINFO
|
|
238
|
+
|
|
239
|
+
#define sv_onstack sv_flags
|
|
240
|
+
#endif
|
|
241
|
+
|
|
242
|
+
struct sigstack {
|
|
243
|
+
char *ss_sp;
|
|
244
|
+
int ss_onstack;
|
|
245
|
+
};
|
|
246
|
+
|
|
247
|
+
#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
|
|
248
|
+
#define sigmask(m) (1 << ((m)-1))
|
|
249
|
+
#define BADSIG SIG_ERR
|
|
250
|
+
#endif
|
|
251
|
+
#endif
|
|
252
|
+
|
|
253
|
+
// the installed libc's signal() keeps its own numbering, so darwin's has its
|
|
254
|
+
// own symbol.
|
|
255
|
+
__BEGIN_DECLS
|
|
256
|
+
void (*signal(int, void (*)(int)))(int) __asm__("__peach_darwin_signal");
|
|
257
|
+
__END_DECLS
|
|
258
|
+
|
|
259
|
+
#endif
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
#pragma once
|
|
2
|
+
// accept, recv and send are socket calls, which original units reach as
|
|
3
|
+
// recorded boundaries: the labels name darwin symbols that no provider defines.
|
|
2
4
|
#include_next <sys/socket.h>
|
|
5
|
+
#include <sys/cdefs.h>
|
|
3
6
|
#define AF_ROUTE 17 /* Internal Routing Protocol */
|
|
4
7
|
#define AF_LINK 18 /* Link layer interface */
|
|
5
8
|
#define PF_ROUTE AF_ROUTE
|
|
6
9
|
#define PF_LINK AF_LINK
|
|
7
10
|
#define NET_RT_IFLIST 3 /* survey interface list */
|
|
11
|
+
__BEGIN_DECLS
|
|
12
|
+
int accept(int, struct sockaddr *__restrict, socklen_t *__restrict) __asm__("__peach_darwin_accept");
|
|
13
|
+
ssize_t recv(int, void *, size_t, int) __asm__("__peach_darwin_recv");
|
|
14
|
+
ssize_t send(int, const void *, size_t, int) __asm__("__peach_darwin_send");
|
|
15
|
+
__END_DECLS
|
|
@@ -2,3 +2,17 @@
|
|
|
2
2
|
#include_next <sys/types.h>
|
|
3
3
|
#include <sys/cdefs.h>
|
|
4
4
|
#include <stdint.h>
|
|
5
|
+
// darwin's sys/types.h keeps its select bit masks for historical callers.
|
|
6
|
+
#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
|
|
7
|
+
#include <sys/_types/_fd_def.h>
|
|
8
|
+
#define NBBY __DARWIN_NBBY /* bits in a byte */
|
|
9
|
+
#define NFDBITS __DARWIN_NFDBITS /* bits per mask */
|
|
10
|
+
#define howmany(x, y) __DARWIN_howmany(x, y) /* # y's == x bits? */
|
|
11
|
+
typedef __int32_t fd_mask;
|
|
12
|
+
#include <sys/_types/_fd_setsize.h>
|
|
13
|
+
#include <sys/_types/_fd_set.h>
|
|
14
|
+
#include <sys/_types/_fd_clr.h>
|
|
15
|
+
#include <sys/_types/_fd_zero.h>
|
|
16
|
+
#include <sys/_types/_fd_isset.h>
|
|
17
|
+
#include <sys/_types/_fd_copy.h>
|
|
18
|
+
#endif
|
|
@@ -22,6 +22,7 @@ typedef _STRUCT_MCONTEXT *mcontext_t;
|
|
|
22
22
|
#ifndef _STRUCT_SIGALTSTACK
|
|
23
23
|
#define _STRUCT_SIGALTSTACK struct __darwin_sigaltstack
|
|
24
24
|
_STRUCT_SIGALTSTACK { void *ss_sp; size_t ss_size; int ss_flags; };
|
|
25
|
+
typedef _STRUCT_SIGALTSTACK stack_t;
|
|
25
26
|
#endif
|
|
26
27
|
#define _STRUCT_UCONTEXT struct __darwin_ucontext
|
|
27
28
|
_STRUCT_UCONTEXT {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
// darwin's cancellation points bind to the darwin provider, which acts on a
|
|
3
|
+
// pending cancel first.
|
|
4
|
+
#include_next <sys/uio.h>
|
|
5
|
+
#include <sys/cdefs.h>
|
|
6
|
+
__BEGIN_DECLS
|
|
7
|
+
ssize_t readv(int, const struct iovec *, int) __asm__("__peach_darwin_readv");
|
|
8
|
+
ssize_t writev(int, const struct iovec *, int) __asm__("__peach_darwin_writev");
|
|
9
|
+
ssize_t preadv(int, const struct iovec *, int, off_t) __asm__("__peach_darwin_preadv");
|
|
10
|
+
ssize_t pwritev(int, const struct iovec *, int, off_t) __asm__("__peach_darwin_pwritev");
|
|
11
|
+
__END_DECLS
|