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

Function protect_setchild

freebsd/kern/kern_procctl.c:52–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50#include <vm/vm_extern.h>
51
52static int
53protect_setchild(struct thread *td, struct proc *p, int flags)
54{
55
56 PROC_LOCK_ASSERT(p, MA_OWNED);
57 if (p->p_flag & P_SYSTEM || p_cansched(td, p) != 0)
58 return (0);
59 if (flags & PPROT_SET) {
60 p->p_flag |= P_PROTECTED;
61 if (flags & PPROT_INHERIT)
62 p->p_flag2 |= P2_INHERIT_PROTECTED;
63 } else {
64 p->p_flag &= ~P_PROTECTED;
65 p->p_flag2 &= ~P2_INHERIT_PROTECTED;
66 }
67 return (1);
68}
69
70static int
71protect_setchildren(struct thread *td, struct proc *top, int flags)

Callers 2

protect_setchildrenFunction · 0.85
protect_setFunction · 0.85

Calls 1

p_canschedFunction · 0.85

Tested by

no test coverage detected