MCPcopy Create free account
hub / github.com/F-Stack/f-stack / protect_setchildren

Function protect_setchildren

freebsd/kern/kern_procctl.c:70–102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68}
69
70static int
71protect_setchildren(struct thread *td, struct proc *top, int flags)
72{
73 struct proc *p;
74 int ret;
75
76 p = top;
77 ret = 0;
78 sx_assert(&proctree_lock, SX_LOCKED);
79 for (;;) {
80 ret |= protect_setchild(td, p, flags);
81 PROC_UNLOCK(p);
82 /*
83 * If this process has children, descend to them next,
84 * otherwise do any siblings, and if done with this level,
85 * follow back up the tree (but not past top).
86 */
87 if (!LIST_EMPTY(&p->p_children))
88 p = LIST_FIRST(&p->p_children);
89 else for (;;) {
90 if (p == top) {
91 PROC_LOCK(p);
92 return (ret);
93 }
94 if (LIST_NEXT(p, p_sibling)) {
95 p = LIST_NEXT(p, p_sibling);
96 break;
97 }
98 p = p->p_pptr;
99 }
100 PROC_LOCK(p);
101 }
102}
103
104static int
105protect_set(struct thread *td, struct proc *p, int flags)

Callers 1

protect_setFunction · 0.85

Calls 1

protect_setchildFunction · 0.85

Tested by

no test coverage detected