From b5cb3ac8ecab71bfe1eb7d5b2d7a48970e11a5b4 Mon Sep 17 00:00:00 2001 From: hsldymq Date: Thu, 28 Jun 2018 02:25:11 +0800 Subject: Make pid & uid available while handling realtime signals --- ext/pcntl/pcntl.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'ext/pcntl/pcntl.c') diff --git a/ext/pcntl/pcntl.c b/ext/pcntl/pcntl.c index 228111d351..36d2a672ab 100644 --- a/ext/pcntl/pcntl.c +++ b/ext/pcntl/pcntl.c @@ -1276,6 +1276,12 @@ static void pcntl_siginfo_to_zval(int signo, siginfo_t *siginfo, zval *user_sigi break; #endif } +#if defined(SIGRTMIN) && defined(SIGRTMAX) + if (SIGRTMIN <= signo && signo <= SIGRTMAX) { + add_assoc_long_ex(user_siginfo, "pid", sizeof("pid")-1, siginfo->si_pid); + add_assoc_long_ex(user_siginfo, "uid", sizeof("uid")-1, siginfo->si_uid); + } +#endif } } /* }}} */ -- cgit v1.2.1