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

Function protmax_ctl

freebsd/kern/kern_procctl.c:422–443  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

420}
421
422static int
423protmax_ctl(struct thread *td, struct proc *p, int state)
424{
425 PROC_LOCK_ASSERT(p, MA_OWNED);
426
427 switch (state) {
428 case PROC_PROTMAX_FORCE_ENABLE:
429 p->p_flag2 &= ~P2_PROTMAX_DISABLE;
430 p->p_flag2 |= P2_PROTMAX_ENABLE;
431 break;
432 case PROC_PROTMAX_FORCE_DISABLE:
433 p->p_flag2 |= P2_PROTMAX_DISABLE;
434 p->p_flag2 &= ~P2_PROTMAX_ENABLE;
435 break;
436 case PROC_PROTMAX_NOFORCE:
437 p->p_flag2 &= ~(P2_PROTMAX_ENABLE | P2_PROTMAX_DISABLE);
438 break;
439 default:
440 return (EINVAL);
441 }
442 return (0);
443}
444
445static int
446protmax_status(struct thread *td, struct proc *p, int *data)

Callers 1

kern_procctl_singleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected