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

Function linker_search_symbol_name_flags

freebsd/kern/kern_linker.c:1023–1042  ·  view source on GitHub ↗

* stack(9) helper for non-debugging environemnts. Unlike DDB helpers, we do * obey locking protocols, and offer a significantly less complex interface. */

Source from the content-addressed store, hash-verified

1021 * obey locking protocols, and offer a significantly less complex interface.
1022 */
1023int
1024linker_search_symbol_name_flags(caddr_t value, char *buf, u_int buflen,
1025 long *offset, int flags)
1026{
1027 int error;
1028
1029 KASSERT((flags & (M_NOWAIT | M_WAITOK)) != 0 &&
1030 (flags & (M_NOWAIT | M_WAITOK)) != (M_NOWAIT | M_WAITOK),
1031 ("%s: bad flags: 0x%x", __func__, flags));
1032
1033 if (flags & M_NOWAIT) {
1034 if (!sx_try_slock(&kld_sx))
1035 return (EWOULDBLOCK);
1036 } else
1037 sx_slock(&kld_sx);
1038
1039 error = linker_debug_search_symbol_name(value, buf, buflen, offset);
1040 sx_sunlock(&kld_sx);
1041 return (error);
1042}
1043
1044int
1045linker_search_symbol_name(caddr_t value, char *buf, u_int buflen,

Callers 2

stack_symbolFunction · 0.85

Calls 1

Tested by

no test coverage detected