summaryrefslogtreecommitdiff
path: root/rts/eventlog
diff options
context:
space:
mode:
authorCheng Shao <astrohavoc@gmail.com>2022-10-22 17:32:05 +0000
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-11-11 00:26:55 -0500
commit3f1e164f68aedee576e87f7548592a221896d229 (patch)
treea7bda8b4cb7807f29194be157a0941962f058e62 /rts/eventlog
parent4d36a1d37d826006b9832f1aabea4c9cd5104a3d (diff)
downloadhaskell-3f1e164f68aedee576e87f7548592a221896d229.tar.gz
rts: use HAVE_GETPID to guard subprocess related logic
We've previously added detection of getpid() in autoconf. This patch uses HAVE_GETPID to guard some subprocess related logic in the RTS. This is required for certain targets like wasm32-wasi, where there isn't a process model at all.
Diffstat (limited to 'rts/eventlog')
-rw-r--r--rts/eventlog/EventLogWriter.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/rts/eventlog/EventLogWriter.c b/rts/eventlog/EventLogWriter.c
index daa6dc3c9d..984b2afb5d 100644
--- a/rts/eventlog/EventLogWriter.c
+++ b/rts/eventlog/EventLogWriter.c
@@ -68,6 +68,9 @@ static char *outputFileName(void)
+ 10 /* .eventlog */,
"initEventLogFileWriter");
+#if !defined(HAVE_GETPID)
+ sprintf(filename, "%s.eventlog", prog);
+#else
if (event_log_pid == -1) { // #4512
// Single process
sprintf(filename, "%s.eventlog", prog);
@@ -82,6 +85,7 @@ static char *outputFileName(void)
sprintf(filename, "%s.%" FMT_Word64 ".eventlog",
prog, (StgWord64)event_log_pid);
}
+#endif
stgFree(prog);
return filename;
}