summaryrefslogtreecommitdiff
path: root/test/regress_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/regress_main.c')
-rw-r--r--test/regress_main.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/regress_main.c b/test/regress_main.c
index 96b5b7ee..05e28433 100644
--- a/test/regress_main.c
+++ b/test/regress_main.c
@@ -33,6 +33,14 @@
#include <fcntl.h>
#endif
+#if defined(__APPLE__) && defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__)
+#if (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1060 && \
+ __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1070)
+#define FORK_BREAKS_GCOV
+#include <vproc.h>
+#endif
+#endif
+
#include "event2/event-config.h"
#ifdef EVENT____func__
@@ -157,6 +165,18 @@ regress_make_tmpfile(const void *data, size_t datalen, char **filename_out)
#endif
}
+#ifndef _WIN32
+pid_t
+regress_fork(void)
+{
+ pid_t pid = fork();
+#ifdef FORK_BREAKS_GCOV
+ vproc_transaction_begin(0);
+#endif
+ return pid;
+}
+#endif
+
static void
ignore_log_cb(int s, const char *msg)
{