2 * This source file is in the public domain.
3 * Garrett A. Wollman, 2002-05-28.
11 * Implement the dlfunc() interface, which behaves exactly the same as
12 * dlsym() except that it returns a function pointer instead of a data
13 * pointer. This can be used by applications to avoid compiler warnings
14 * about undefined behavior, and is intended as prior art for future
15 * POSIX standardization. This function requires that all pointer types
16 * have the same representation, which is true on all platforms FreeBSD
17 * runs on, but is not guaranteed by the C standard.
20 dlfunc(void * __restrict handle, const char * __restrict symbol)
27 rv.d = dlsym(handle, symbol);