aboutsummaryrefslogtreecommitdiffstats
path: root/process.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2023-05-21 23:00:27 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2023-05-21 23:00:27 +0900
commit7f7a8fa555c3f12996114d13dc6908ea4e73c5b3 (patch)
treee7fb6eea87f7b7e19132edfd97824619b63e119c /process.c
parent08675889802be222ae01db7d0d54c7e1b45bffc5 (diff)
downloadruby-7f7a8fa555c3f12996114d13dc6908ea4e73c5b3.tar.gz
Put `rb_fork` back into process.c
Now, calling `rb_fork` directly breaks the PID cache and the timer thread, so must use `rb_fork_ruby` or similar instead.
Diffstat (limited to 'process.c')
-rw-r--r--process.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/process.c b/process.c
index 7dbfca55f0..c54e11860e 100644
--- a/process.c
+++ b/process.c
@@ -1573,6 +1573,17 @@ after_fork_ruby(rb_pid_t pid)
#if defined(HAVE_WORKING_FORK)
+COMPILER_WARNING_PUSH
+#if __has_warning("-Wdeprecated-declarations") || RBIMPL_COMPILER_IS(GCC)
+COMPILER_WARNING_IGNORED(-Wdeprecated-declarations)
+#endif
+static inline rb_pid_t
+rb_fork(void)
+{
+ return fork();
+}
+COMPILER_WARNING_POP
+
/* try_with_sh and exec_with_sh should be async-signal-safe. Actually it is.*/
#define try_with_sh(err, prog, argv, envp) ((err == ENOEXEC) ? exec_with_sh((prog), (argv), (envp)) : (void)0)
static void