#include <mono/metadata/verify-internals.h>
#include <mono/metadata/mempool-internals.h>
#include <mono/metadata/attach.h>
+#include <mono/metadata/gc-internal.h>
#include <mono/utils/mono-math.h>
#include <mono/utils/mono-compiler.h>
#include <mono/utils/mono-counters.h>
#include <mach/task.h>
#include <pthread.h>
#include <dlfcn.h>
+#include <AvailabilityMacros.h>
/*
* This code disables the CrashReporter of MacOS X by installing
mach_exception_port,
EXCEPTION_DEFAULT,
MACHINE_THREAD_STATE) == KERN_SUCCESS);
+
+ mono_gc_register_mach_exception_thread (thread);
}
+/* This is #define'd by Boehm GC to _GC_dlopen. */
+#undef dlopen
+
void
mono_runtime_install_handlers (void)
{
+#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_5
macosx_register_exception_handler ();
+#endif
mono_runtime_posix_install_handlers ();
/* Snow Leopard has a horrible bug: http://openradar.appspot.com/7209349
pid_t
mono_runtime_syscall_fork ()
{
-#if defined(__i386__)
- /* Apple's fork syscall returns a regpair in EAX:EDX.
- * EAX == pid of caller always
- * EDX == 0 for parent, 1 for child
- */
- register_t eax;
- register_t edx;
- pid_t pid;
-
- __asm__ __volatile__ (
- "mov $0x2, %%eax;"
- "int $0x80;"
- "mov %%eax, %0;"
- "mov %%edx, %1;"
- : "=m" (eax), "=m" (edx));
-
- if (edx == 0) {
- pid = eax;
- } else if (edx == 1) {
- pid = 0;
- } else {
- g_assert_not_reached ();
- }
-
- return pid;
-#else
- g_assert_not_reached ();
-#endif
+ return (pid_t) fork ();
}
gboolean