2 * This source file is in the public domain.
3 * Garrett A. Wollman, 2002-05-28.
5 * $FreeBSD: src/lib/libc/gen/dlfunc.c,v 1.3 2002/09/11 05:05:48 mike Exp $
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
);