mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
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. close GH-14266
This commit is contained in:
parent
ace18f4919
commit
fe7f699c0a
2 changed files with 15 additions and 0 deletions
1
NEWS
1
NEWS
|
@ -146,6 +146,7 @@ PHP NEWS
|
||||||
. Added pcntl_getcpu for Linux/FreeBSD/Solaris/Illumos. (David Carlier)
|
. Added pcntl_getcpu for Linux/FreeBSD/Solaris/Illumos. (David Carlier)
|
||||||
. Added pcntl_getqos_class/pcntl_setqos_class for macOs. (David Carlier)
|
. Added pcntl_getqos_class/pcntl_setqos_class for macOs. (David Carlier)
|
||||||
. Added SIGCKPT/SIGCKPTEXIT constants for DragonFlyBSD. (David Carlier)
|
. Added SIGCKPT/SIGCKPTEXIT constants for DragonFlyBSD. (David Carlier)
|
||||||
|
. Added FreeBSD's SIGTRAP handling to pcntl_siginfo_to_zval. (David Carlier)
|
||||||
|
|
||||||
- PCRE:
|
- PCRE:
|
||||||
. Upgrade bundled pcre2lib to version 10.43. (nielsdos)
|
. Upgrade bundled pcre2lib to version 10.43. (nielsdos)
|
||||||
|
|
|
@ -1067,6 +1067,20 @@ static void pcntl_siginfo_to_zval(int signo, siginfo_t *siginfo, zval *user_sigi
|
||||||
add_assoc_long_ex(user_siginfo, "fd", sizeof("fd")-1, siginfo->si_fd);
|
add_assoc_long_ex(user_siginfo, "fd", sizeof("fd")-1, siginfo->si_fd);
|
||||||
# endif
|
# endif
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef SIGTRAP
|
||||||
|
case SIGTRAP:
|
||||||
|
# if defined(si_syscall) && defined(__FreeBSD__)
|
||||||
|
if (siginfo->si_code == TRAP_CAP) {
|
||||||
|
add_assoc_long_ex(user_siginfo, "syscall", sizeof("syscall")-1, (zend_long)siginfo->si_syscall);
|
||||||
|
} else {
|
||||||
|
add_assoc_long_ex(user_siginfo, "trapno", sizeof("trapno")-1, (zend_long)siginfo->si_trapno);
|
||||||
|
}
|
||||||
|
|
||||||
|
# endif
|
||||||
|
break;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#if defined(SIGRTMIN) && defined(SIGRTMAX)
|
#if defined(SIGRTMIN) && defined(SIGRTMAX)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue