Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/imgact_elf.c
| Show First 20 Lines • Show All 1,864 Lines • ▼ Show 20 Lines | note_procstat_files(void *arg, struct sbuf *sb, size_t *sizep) | ||||
| p = (struct proc *)arg; | p = (struct proc *)arg; | ||||
| if (sb == NULL) { | if (sb == NULL) { | ||||
| size = 0; | size = 0; | ||||
| sb = sbuf_new(NULL, NULL, 128, SBUF_FIXEDLEN); | sb = sbuf_new(NULL, NULL, 128, SBUF_FIXEDLEN); | ||||
| sbuf_set_drain(sb, sbuf_drain_count, &size); | sbuf_set_drain(sb, sbuf_drain_count, &size); | ||||
| sbuf_bcat(sb, &structsize, sizeof(structsize)); | sbuf_bcat(sb, &structsize, sizeof(structsize)); | ||||
| PROC_LOCK(p); | PROC_LOCK(p); | ||||
| kern_proc_filedesc_out(p, sb, -1); | kern_proc_filedesc_out(p, sb, -1, LK_NOWAIT); | ||||
| sbuf_finish(sb); | sbuf_finish(sb); | ||||
| sbuf_delete(sb); | sbuf_delete(sb); | ||||
| *sizep = size; | *sizep = size; | ||||
| } else { | } else { | ||||
| structsize = sizeof(struct kinfo_file); | structsize = sizeof(struct kinfo_file); | ||||
| sbuf_bcat(sb, &structsize, sizeof(structsize)); | sbuf_bcat(sb, &structsize, sizeof(structsize)); | ||||
| PROC_LOCK(p); | PROC_LOCK(p); | ||||
| kern_proc_filedesc_out(p, sb, -1); | kern_proc_filedesc_out(p, sb, -1, LK_NOWAIT); | ||||
| } | } | ||||
| } | } | ||||
| #ifdef KINFO_VMENTRY_SIZE | #ifdef KINFO_VMENTRY_SIZE | ||||
| CTASSERT(sizeof(struct kinfo_vmentry) == KINFO_VMENTRY_SIZE); | CTASSERT(sizeof(struct kinfo_vmentry) == KINFO_VMENTRY_SIZE); | ||||
| #endif | #endif | ||||
| static void | static void | ||||
| ▲ Show 20 Lines • Show All 271 Lines • Show Last 20 Lines | |||||