int status;
pid_t crashed_pid = getpid ();
- //pid = fork ();
/*
* glibc fork acquires some locks, so if the crash happened inside malloc/free,
* it will deadlock. Call the syscall directly instead.
*/
- pid = mono_runtime_syscall_fork ();
+#if defined(PLATFORM_ANDROID)
+ /* SYS_fork is defined to be __NR_fork which is not defined in some ndk versions */
+ g_assert_not_reached ();
+#elif defined(SYS_fork)
+ pid = (pid_t) syscall (SYS_fork);
+#elif defined(PLATFORM_MACOSX) && HAVE_FORK
+ pid = (pid_t) fork ();
+#else
+ g_assert_not_reached ();
+#endif
+
#if defined (HAVE_PRCTL) && defined(PR_SET_PTRACER)
if (pid > 0) {
// Allow gdb to attach to the process even if ptrace_scope sysctl variable is set to
#if defined(__native_client__)
-pid_t
-mono_runtime_syscall_fork ()
-{
- g_assert_not_reached ();
-}
-
void
mono_gdb_render_native_backtraces (pid_t crashed_pid)
{
void mono_runtime_setup_stat_profiler (void);
void mono_runtime_shutdown_stat_profiler (void);
void mono_runtime_posix_install_handlers (void);
-pid_t mono_runtime_syscall_fork (void);
void mono_gdb_render_native_backtraces (pid_t crashed_pid);
void mono_cross_helpers_run (void);