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

Function logopen

freebsd/kern/subr_log.c:107–128  ·  view source on GitHub ↗

ARGSUSED*/

Source from the content-addressed store, hash-verified

105
106/*ARGSUSED*/
107static int
108logopen(struct cdev *dev, int flags, int mode, struct thread *td)
109{
110
111 if (log_wakeups_per_second < 1) {
112 printf("syslog wakeup is less than one. Adjusting to 1.\n");
113 log_wakeups_per_second = 1;
114 }
115
116 mtx_lock(&msgbuf_lock);
117 if (log_open) {
118 mtx_unlock(&msgbuf_lock);
119 return (EBUSY);
120 }
121 log_open = 1;
122 callout_reset_sbt(&logsoftc.sc_callout,
123 SBT_1S / log_wakeups_per_second, 0, logtimeout, NULL, C_PREL(1));
124 mtx_unlock(&msgbuf_lock);
125
126 fsetown(td->td_proc->p_pid, &logsoftc.sc_sigio); /* signal process only */
127 return (0);
128}
129
130/*ARGSUSED*/
131static int

Callers

nothing calls this directly

Calls 4

fsetownFunction · 0.85
printfFunction · 0.70
mtx_lockFunction · 0.70
mtx_unlockFunction · 0.70

Tested by

no test coverage detected