Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/imgact_elf.c
Show First 20 Lines • Show All 232 Lines • ▼ Show 20 Lines | __elfN(remove_brand_entry)(Elf_Brandinfo *entry) | ||||
if (i == MAX_BRANDS) | if (i == MAX_BRANDS) | ||||
return (-1); | return (-1); | ||||
return (0); | return (0); | ||||
} | } | ||||
int | int | ||||
__elfN(brand_inuse)(Elf_Brandinfo *entry) | __elfN(brand_inuse)(Elf_Brandinfo *entry) | ||||
{ | { | ||||
VPS_ITERATOR_DECL(vps_iter); | |||||
struct proc *p; | struct proc *p; | ||||
int rval = FALSE; | int rval = FALSE; | ||||
sx_slock(&allproc_lock); | VPS_LIST_RLOCK(); | ||||
VPS_FOREACH(vps_iter) { | |||||
CURVPS_SET(vps_iter); | |||||
sx_slock(&V_allproc_lock); | |||||
FOREACH_PROC_IN_SYSTEM(p) { | FOREACH_PROC_IN_SYSTEM(p) { | ||||
if (p->p_sysent == entry->sysvec) { | if (p->p_sysent == entry->sysvec) { | ||||
rval = TRUE; | rval = TRUE; | ||||
break; | break; | ||||
} | } | ||||
} | } | ||||
sx_sunlock(&allproc_lock); | sx_sunlock(&V_allproc_lock); | ||||
CURVPS_RESTORE(); | |||||
} | |||||
VPS_LIST_RUNLOCK(); | |||||
return (rval); | return (rval); | ||||
} | } | ||||
static Elf_Brandinfo * | static Elf_Brandinfo * | ||||
__elfN(get_brandinfo)(struct image_params *imgp, const char *interp, | __elfN(get_brandinfo)(struct image_params *imgp, const char *interp, | ||||
int interp_name_len, int32_t *osrel) | int interp_name_len, int32_t *osrel) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 1,841 Lines • ▼ Show 20 Lines | __elfN(note_procstat_proc)(void *arg, struct sbuf *sb, size_t *sizep) | ||||
p = (struct proc *)arg; | p = (struct proc *)arg; | ||||
size = sizeof(structsize) + p->p_numthreads * | size = sizeof(structsize) + p->p_numthreads * | ||||
sizeof(elf_kinfo_proc_t); | sizeof(elf_kinfo_proc_t); | ||||
if (sb != NULL) { | if (sb != NULL) { | ||||
KASSERT(*sizep == size, ("invalid size")); | KASSERT(*sizep == size, ("invalid size")); | ||||
structsize = sizeof(elf_kinfo_proc_t); | structsize = sizeof(elf_kinfo_proc_t); | ||||
sbuf_bcat(sb, &structsize, sizeof(structsize)); | sbuf_bcat(sb, &structsize, sizeof(structsize)); | ||||
sx_slock(&proctree_lock); | sx_slock(&V_proctree_lock); | ||||
PROC_LOCK(p); | PROC_LOCK(p); | ||||
kern_proc_out(p, sb, ELF_KERN_PROC_MASK); | kern_proc_out(p, sb, ELF_KERN_PROC_MASK); | ||||
sx_sunlock(&proctree_lock); | sx_sunlock(&V_proctree_lock); | ||||
} | } | ||||
*sizep = size; | *sizep = size; | ||||
} | } | ||||
#ifdef KINFO_FILE_SIZE | #ifdef KINFO_FILE_SIZE | ||||
CTASSERT(sizeof(struct kinfo_file) == KINFO_FILE_SIZE); | CTASSERT(sizeof(struct kinfo_file) == KINFO_FILE_SIZE); | ||||
#endif | #endif | ||||
▲ Show 20 Lines • Show All 357 Lines • Show Last 20 Lines |