aboutsummaryrefslogtreecommitdiff
path: root/sbin/devd/(developers-only)
diff options
context:
space:
mode:
authorXin LI <delphij@FreeBSD.org>2026-10-06 07:17:21 +0000
committerXin LI <delphij@FreeBSD.org>2026-10-06 08:10:57 +0000
commitb4e2c9abaf14d6eabbce59656d448c064e0dc40b (patch)
tree6ffbb2576932029c6f1b6ea8178823663dbe5bc6 /sbin/devd/(developers-only)
parentea23918b025baf72a43c0ce6f3f505ef153c2644 (diff)
libcasper: tolerate kernels without PD_NOWAITPIDHEADmain
Commit 1a296762b3d0 made libcasper pass PD_NOWAITPID to pdfork(2). Kernels predating the flag (15.1 and earlier, since the flag first ships in 15.2) reject it with EINVAL, which makes cap_init() and every service fork fail when a newer world runs on an older kernel, for example in a poudriere jail. Add casper_pdfork(), which retries without the flag on EINVAL, and use it at both pdfork(2) call sites. The retry is safe because the kernel validates pdfork flags before creating a child. On such kernels the zombie must still be reaped with waitpid(2), as before the flag was introduced. The fallback is compiled out once __FreeBSD_version reaches 1700000, so it disappears from main when stable/16 branches while remaining in the stable/15 and stable/16 branches that need it. Reviewed by: kib MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D60401
Diffstat (limited to 'sbin/devd/(developers-only)')
0 files changed, 0 insertions, 0 deletions