FreeBSD/sys/kern/kern_linker.c
/*
 * Export a nul-separated, double-nul-terminated list of all function names
 * in the kernel.
 */
Export a nul-separated, double-nul-terminated list of all function names
in the kernel.
Export a nul - separated double - nul - terminated list of all function names in the kernel .
static int
sysctl_kern_function_list(SYSCTL_HANDLER_ARGS)
{
	linker_file_t lf;
	int error;
#ifdef MAC
	error = mac_kld_check_stat(req->td->td_ucred);
	if (error)
		return (error);
#endif
	error = sysctl_wire_old_buffer(req, 0);
	if (error != 0)
		return (error);
	sx_xlock(&kld_sx);
	TAILQ_FOREACH(lf, &linker_files, link) {
		error = LINKER_EACH_FUNCTION_NAME(lf,
		    sysctl_kern_function_list_iterate, req);
		if (error) {
			sx_xunlock(&kld_sx);
			return (error);
		}
	}
	sx_xunlock(&kld_sx);
	return (SYSCTL_OUT(req, "", 1));
}
static int sysctl_kern_function_list ( SYSCTL_HANDLER_ARGS ) { linker_file_t lf ; int error ; #ifdef MAC error = mac_kld_check_stat ( req -> td -> td_ucred ) ; if ( error ) return ( error ) ; #endif error = sysctl_wire_old_buffer ( req , 0 ) ; if ( error != 0 ) return ( error ) ; sx_xlock ( & kld_sx ) ; TAILQ_FOREACH ( lf , & linker_files , link ) { error = LINKER_EACH_FUNCTION_NAME ( lf , sysctl_kern_function_list_iterate , req ) ; if ( error ) { sx_xunlock ( & kld_sx ) ; return ( error ) ; } } sx_xunlock ( & kld_sx ) ; return ( SYSCTL_OUT ( req , " " , 1 ) ) ; }
Export a nul-separated, double-nul-terminated list of all function names
 in the kernel.
Export a nul - separated double - nul - terminated list of all function names in the kernel .