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

Function kproc_kthread_add

freebsd/kern/kern_kthread.c:461–493  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

459}
460
461int
462kproc_kthread_add(void (*func)(void *), void *arg,
463 struct proc **procptr, struct thread **tdptr,
464 int flags, int pages, const char *procname, const char *fmt, ...)
465{
466 int error;
467 va_list ap;
468 char buf[100];
469 struct thread *td;
470
471 if (*procptr == NULL) {
472 error = kproc_create(func, arg,
473 procptr, flags, pages, "%s", procname);
474 if (error)
475 return (error);
476 td = FIRST_THREAD_IN_PROC(*procptr);
477 if (tdptr)
478 *tdptr = td;
479 va_start(ap, fmt);
480 vsnprintf(td->td_name, sizeof(td->td_name), fmt, ap);
481 va_end(ap);
482#ifdef KTR
483 sched_clear_tdname(td);
484#endif
485 return (0);
486 }
487 va_start(ap, fmt);
488 vsnprintf(buf, sizeof(buf), fmt, ap);
489 va_end(ap);
490 error = kthread_add(func, arg, *procptr,
491 tdptr, flags, pages, "%s", buf);
492 return (error);
493}

Callers 8

idle_setupFunction · 0.70
ktls_initFunction · 0.70
ithread_createFunction · 0.70
ddi_sysevent_initFunction · 0.50
zvol_geom_runFunction · 0.50
do_thread_createFunction · 0.50
create_msgring_threadFunction · 0.50
ngb_mod_eventFunction · 0.50

Calls 4

kproc_createFunction · 0.85
vsnprintfFunction · 0.85
sched_clear_tdnameFunction · 0.70
kthread_addFunction · 0.70

Tested by

no test coverage detected