FreeBSD/sys/kern/imgact_binmisc.c
/*
 * Get a snapshot of all the interpreter entries in the list.
 */
Get a snapshot of all the interpreter entries in the list.
Get a snapshot of all the interpreter entries in the list .
static int
imgact_binmisc_get_all_entries(struct sysctl_req *req)
{
	ximgact_binmisc_entry_t *xbe, *xbep;
	imgact_binmisc_entry_t *ibe;
	int error = 0, count;
	sx_slock(&interp_list_sx);
	count = interp_list_entry_count;
	xbe = malloc(sizeof(*xbe) * count, M_BINMISC, M_WAITOK|M_ZERO);
	xbep = xbe;
	SLIST_FOREACH(ibe, &interpreter_list, link) {
		error = imgact_binmisc_populate_xbe(xbep++, ibe);
		if (error)
			break;
	}
	sx_sunlock(&interp_list_sx);
	if (!error)
		error = SYSCTL_OUT(req, xbe, sizeof(*xbe) * count);
	free(xbe, M_BINMISC);
	return (error);
}
static int imgact_binmisc_get_all_entries ( struct sysctl_req * req ) { ximgact_binmisc_entry_t * xbe , * xbep ; imgact_binmisc_entry_t * ibe ; int error = 0 , count ; sx_slock ( & interp_list_sx ) ; count = interp_list_entry_count ; xbe = malloc ( sizeof ( * xbe ) * count , M_BINMISC , M_WAITOK | M_ZERO ) ; xbep = xbe ; SLIST_FOREACH ( ibe , & interpreter_list , link ) { error = imgact_binmisc_populate_xbe ( xbep ++ , ibe ) ; if ( error ) break ; } sx_sunlock ( & interp_list_sx ) ; if ( ! error ) error = SYSCTL_OUT ( req , xbe , sizeof ( * xbe ) * count ) ; free ( xbe , M_BINMISC ) ; return ( error ) ; }
Get a snapshot of all the interpreter entries in the list.
Get a snapshot of all the interpreter entries in the list .