Skip to content

Commit 57942e0

Browse files
committed
ext/pcntl: adding SIGTRAP handling for freebsd.
if a restricted file descriptor based syscall by the system had been attempted, a SIGTRAP is raised with the syscall id.
1 parent 5276734 commit 57942e0

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

ext/pcntl/pcntl.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1067,6 +1067,17 @@ static void pcntl_siginfo_to_zval(int signo, siginfo_t *siginfo, zval *user_sigi
10671067
add_assoc_long_ex(user_siginfo, "fd", sizeof("fd")-1, siginfo->si_fd);
10681068
# endif
10691069
break;
1070+
#endif
1071+
1072+
#ifdef SIGTRAP
1073+
case SIGTRAP:
1074+
# ifdef si_syscall
1075+
add_assoc_long_ex(user_siginfo, "syscall", sizeof("syscall")-1, (zend_long)siginfo->si_syscall);
1076+
# endif
1077+
# ifdef si_trapno
1078+
add_assoc_long_ex(user_siginfo, "trapno", sizeof("trapno")-1, (zend_long)siginfo->si_trapno);
1079+
# endif
1080+
10701081
#endif
10711082
}
10721083
#if defined(SIGRTMIN) && defined(SIGRTMAX)

0 commit comments

Comments
 (0)