diff --git a/include/dlfcn.h b/include/dlfcn.h index de654f76a31b..794fde109b39 100644 --- a/include/dlfcn.h +++ b/include/dlfcn.h @@ -113,8 +113,7 @@ typedef struct dl_serinfo { __BEGIN_DECLS /* XSI functions first. */ int dlclose(void *); -const char * - dlerror(void); +char *dlerror(void); void *dlopen(const char *, int); void *dlsym(void * __restrict, const char * __restrict); diff --git a/lib/libc/gen/dlfcn.c b/lib/libc/gen/dlfcn.c index 4be88475a91a..a1ca29daceb4 100644 --- a/lib/libc/gen/dlfcn.c +++ b/lib/libc/gen/dlfcn.c @@ -34,7 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include -static const char sorry[] = "Service unavailable"; +static char sorry[] = "Service unavailable"; /* * For ELF, the dynamic linker directly resolves references to its @@ -69,7 +69,7 @@ dlclose(void *handle) } #pragma weak dlerror -const char * +char * dlerror(void) { return sorry; diff --git a/lib/libc/gen/dlopen.3 b/lib/libc/gen/dlopen.3 index 6488befeeb53..d4b111a10026 100644 --- a/lib/libc/gen/dlopen.3 +++ b/lib/libc/gen/dlopen.3 @@ -52,7 +52,7 @@ .Fn dlsym "void * restrict handle" "const char * restrict symbol" .Ft dlfunc_t .Fn dlfunc "void * restrict handle" "const char * restrict symbol" -.Ft const char * +.Ft char * .Fn dlerror "void" .Ft int .Fn dlclose "void *handle" diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index d91dcee51a71..cb1002cd8d03 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -1961,7 +1961,7 @@ dlclose(void *handle) return 0; } -const char * +char * dlerror(void) { char *msg = error_message;