Index: process.c =================================================================== --- process.c (revision 26425) +++ process.c (working copy) @@ -1331,11 +1331,11 @@ fflush(stderr); #endif -#ifdef __NetBSD__ +#if defined(__NetBSD__) || defined(__APPLE__) before_exec(); #endif pid = fork(); -#ifdef __NetBSD__ +#if defined(__NetBSD__) || defined(__APPLE__) after_exec(); #endif switch (pid) { @@ -1578,7 +1578,7 @@ chfunc = signal(SIGCHLD, SIG_DFL); retry: -#ifdef __NetBSD__ +#if defined(__NetBSD__) || defined(__APPLE__) before_exec(); #endif pid = fork(); @@ -1588,7 +1588,7 @@ rb_protect(proc_exec_args, (VALUE)&earg, NULL); _exit(127); } -#ifdef __NetBSD__ +#if defined(__NetBSD__) || defined(__APPLE__) after_exec(); #endif if (pid < 0) { Index: eval.c =================================================================== --- eval.c (revision 26425) +++ eval.c (working copy) @@ -12520,7 +12520,7 @@ safe_mutex_lock(&time_thread.lock); if (pthread_create(&time_thread.thread, 0, thread_timer, args) == 0) { thread_init = 1; -#ifndef __NetBSD__ +#if !defined(__NetBSD__) && !defined(__APPLE__) pthread_atfork(0, 0, rb_thread_stop_timer); #endif pthread_cond_wait(&start, &time_thread.lock); Index: io.c =================================================================== --- io.c (revision 26425) +++ io.c (working copy) @@ -3267,7 +3267,7 @@ } retry: -#ifdef __NetBSD__ +#if defined(__NetBSD__) || defined(__APPLE__) rb_thread_stop_timer(); #endif switch ((pid = fork())) { @@ -3297,7 +3297,7 @@ ruby_sourcefile, ruby_sourceline, pname); _exit(127); } -#ifdef __NetBSD__ +#if defined(__NetBSD__) || defined(__APPLE__) rb_thread_start_timer(); #endif rb_io_synchronized(RFILE(orig_stdout)->fptr); @@ -3305,7 +3305,7 @@ return Qnil; case -1: /* fork failed */ -#ifdef __NetBSD__ +#if defined(__NetBSD__) || defined(__APPLE__) rb_thread_start_timer(); #endif if (errno == EAGAIN) { @@ -3328,7 +3328,7 @@ break; default: /* parent */ -#ifdef __NetBSD__ +#if defined(__NetBSD__) || defined(__APPLE__) rb_thread_start_timer(); #endif if (pid < 0) rb_sys_fail(pname);