Skip to content

Commit 46faa15

Browse files
jpportofacebook-github-bot
authored andcommitted
Enable some syscalls to resume after SIGPROF
Summary: Add the SA_RESTART flag when registering the SIGPROF handler to allow some system calls to be resumed if interrupted by SIGPROF. For example, the hermes CLI tool would not work propertly after enabling the sampling profiler as the interrupt handler would cause the read() calls to fail. Reviewed By: kodafb Differential Revision: D33594168 fbshipit-source-id: 5c52676aec9316635f343606d7d3012a42249249
1 parent 8bebc9b commit 46faa15

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/VM/Profiler/SamplingProfilerPosix.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ int SamplingProfiler::GlobalProfiler::invokeSignalAction(void (*handler)(int)) {
7676
struct sigaction actions;
7777
memset(&actions, 0, sizeof(actions));
7878
sigemptyset(&actions.sa_mask);
79-
actions.sa_flags = 0;
79+
// Allows interrupted IO primitives to restart.
80+
actions.sa_flags = SA_RESTART;
8081
actions.sa_handler = handler;
8182
return sigaction(SIGPROF, &actions, nullptr);
8283
}

0 commit comments

Comments
 (0)