mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-10-28 11:25:21 +01:00
kern_fork.c: add kern.pdfork_implicit_nowaitpid sysctl
Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D59349
This commit is contained in:
1 parent
c63c77b3a5
commit
24d3cbaaf5
1 file changed
+7
-1
@@ -91,6 +91,11 @@ dtrace_fork_func_t dtrace_fasttrap_fork;
|
||||
SDT_PROVIDER_DECLARE(proc);
|
||||
SDT_PROBE_DEFINE3(proc, , , create, "struct proc *", "struct proc *", "int");
|
||||
|
||||
static bool pdfork_implicit_nowaitpid;
|
||||
SYSCTL_BOOL(_kern, OID_AUTO, pdfork_implicit_nowaitpid, CTLFLAG_RWTUN,
|
||||
&pdfork_implicit_nowaitpid, 0,
|
||||
"PD_NOWAITPID is assumed to be always set");
|
||||
|
||||
#ifndef _SYS_SYSPROTO_H_
|
||||
struct fork_args {
|
||||
int dummy;
|
||||
@@ -560,7 +565,8 @@ do_fork(struct thread *td, struct fork_req *fr, struct proc *p2, struct thread *
|
||||
P2_LOGSIGEXIT_ENABLE);
|
||||
if ((fr->fr_flags & RFPROCDESC) != 0) {
|
||||
p2->p_zombieref = PZOMBIEREF_PROCDESC;
|
||||
if ((fr->fr_pd_flags & PD_NOWAITPID) == 0 &&
|
||||
if (((fr->fr_pd_flags & PD_NOWAITPID) == 0 &&
|
||||
!pdfork_implicit_nowaitpid) &&
|
||||
(fr->fr_flags & RFNOWAIT) == 0)
|
||||
p2->p_zombieref |= (PZOMBIEREF_PARENT |
|
||||
PZOMBIEREF_NEEDPARENT);
|
||||
|
||||
Reference in new issue
Block a user