MCPcopy Create free account
hub / github.com/F-Stack/f-stack / __elfN(note_procstat_proc)

Function __elfN(note_procstat_proc)

freebsd/kern/imgact_elf.c:2382–2403  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2380#endif
2381
2382static void
2383__elfN(note_procstat_proc)(void *arg, struct sbuf *sb, size_t *sizep)
2384{
2385 struct proc *p;
2386 size_t size;
2387 int structsize;
2388
2389 p = (struct proc *)arg;
2390 size = sizeof(structsize) + p->p_numthreads *
2391 sizeof(elf_kinfo_proc_t);
2392
2393 if (sb != NULL) {
2394 KASSERT(*sizep == size, ("invalid size"));
2395 structsize = sizeof(elf_kinfo_proc_t);
2396 sbuf_bcat(sb, &structsize, sizeof(structsize));
2397 sx_slock(&proctree_lock);
2398 PROC_LOCK(p);
2399 kern_proc_out(p, sb, ELF_KERN_PROC_MASK);
2400 sx_sunlock(&proctree_lock);
2401 }
2402 *sizep = size;
2403}
2404
2405#ifdef KINFO_FILE_SIZE
2406CTASSERT(sizeof(struct kinfo_file) == KINFO_FILE_SIZE);

Callers

nothing calls this directly

Calls 2

sbuf_bcatFunction · 0.85
kern_proc_outFunction · 0.85

Tested by

no test coverage detected