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

Function sysctl_kern_msgbuf_clear

freebsd/kern/subr_prf.c:1085–1097  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1083static int msgbuf_clearflag;
1084
1085static int
1086sysctl_kern_msgbuf_clear(SYSCTL_HANDLER_ARGS)
1087{
1088 int error;
1089 error = sysctl_handle_int(oidp, oidp->oid_arg1, oidp->oid_arg2, req);
1090 if (!error && req->newptr) {
1091 mtx_lock(&msgbuf_lock);
1092 msgbuf_clear(msgbufp);
1093 mtx_unlock(&msgbuf_lock);
1094 msgbuf_clearflag = 0;
1095 }
1096 return (error);
1097}
1098
1099SYSCTL_PROC(_kern, OID_AUTO, msgbuf_clear,
1100 CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_SECURE | CTLFLAG_MPSAFE,

Callers

nothing calls this directly

Calls 4

sysctl_handle_intFunction · 0.85
msgbuf_clearFunction · 0.85
mtx_lockFunction · 0.70
mtx_unlockFunction · 0.70

Tested by

no test coverage detected