diff options
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/gen/Makefile.inc | 2 | ||||
-rw-r--r-- | lib/libc/gen/dlfcn.c | 8 | ||||
-rw-r--r-- | lib/libc/gen/dlfunc.c | 30 |
3 files changed, 9 insertions, 31 deletions
diff --git a/lib/libc/gen/Makefile.inc b/lib/libc/gen/Makefile.inc index a7997ab..0ee2ffb 100644 --- a/lib/libc/gen/Makefile.inc +++ b/lib/libc/gen/Makefile.inc @@ -9,7 +9,7 @@ SRCS+= __getosreldate.c __xuname.c \ alarm.c arc4random.c assert.c basename.c check_utility_compat.c \ clock.c closedir.c confstr.c \ crypt.c ctermid.c daemon.c devname.c dirname.c disklabel.c \ - dlfcn.c dlfunc.c drand48.c erand48.c err.c errlst.c errno.c \ + dlfcn.c drand48.c erand48.c err.c errlst.c errno.c \ exec.c fdevname.c feature_present.c fmtcheck.c fmtmsg.c fnmatch.c \ fpclassify.c frexp.c fstab.c ftok.c fts.c fts-compat.c ftw.c \ getbootfile.c getbsize.c \ diff --git a/lib/libc/gen/dlfcn.c b/lib/libc/gen/dlfcn.c index eac3f1a..4be8847 100644 --- a/lib/libc/gen/dlfcn.c +++ b/lib/libc/gen/dlfcn.c @@ -105,6 +105,14 @@ dlsym(void * __restrict handle, const char * __restrict name) return NULL; } +#pragma weak dlfunc +dlfunc_t +dlfunc(void * __restrict handle, const char * __restrict name) +{ + _rtld_error(sorry); + return NULL; +} + #pragma weak dlvsym void * dlvsym(void * __restrict handle, const char * __restrict name, diff --git a/lib/libc/gen/dlfunc.c b/lib/libc/gen/dlfunc.c deleted file mode 100644 index 72a683a..0000000 --- a/lib/libc/gen/dlfunc.c +++ /dev/null @@ -1,30 +0,0 @@ -/* - * This source file is in the public domain. - * Garrett A. Wollman, 2002-05-28. - * - * $FreeBSD$ - */ - -#include <dlfcn.h> - -/* - * Implement the dlfunc() interface, which behaves exactly the same as - * dlsym() except that it returns a function pointer instead of a data - * pointer. This can be used by applications to avoid compiler warnings - * about undefined behavior, and is intended as prior art for future - * POSIX standardization. This function requires that all pointer types - * have the same representation, which is true on all platforms FreeBSD - * runs on, but is not guaranteed by the C standard. - */ -dlfunc_t -dlfunc(void * __restrict handle, const char * __restrict symbol) -{ - union { - void *d; - dlfunc_t f; - } rv; - - rv.d = dlsym(handle, symbol); - return (rv.f); -} - |