MCPcopy Create free account
hub / github.com/F-Stack/f-stack / linker_search_kld

Function linker_search_kld

freebsd/kern/kern_linker.c:1992–2013  ·  view source on GitHub ↗

* Search for module in all directories listed in the linker_path. */

Source from the content-addressed store, hash-verified

1990 * Search for module in all directories listed in the linker_path.
1991 */
1992static char *
1993linker_search_kld(const char *name)
1994{
1995 char *cp, *ep, *result;
1996 int len;
1997
1998 /* qualified at all? */
1999 if (strchr(name, '/'))
2000 return (strdup(name, M_LINKER));
2001
2002 /* traverse the linker path */
2003 len = strlen(name);
2004 for (ep = linker_path; *ep; ep++) {
2005 cp = ep;
2006 /* find the end of this component */
2007 for (; *ep != 0 && *ep != ';'; ep++);
2008 result = linker_lookup_file(cp, ep - cp, name, len, NULL);
2009 if (result != NULL)
2010 return (result);
2011 }
2012 return (NULL);
2013}
2014
2015static const char *
2016linker_basename(const char *path)

Callers 1

linker_load_moduleFunction · 0.85

Calls 3

strchrFunction · 0.85
strdupFunction · 0.85
linker_lookup_fileFunction · 0.85

Tested by

no test coverage detected