mirror of
git://git.musl-libc.org/musl
synced 2025-03-22 02:47:30 +00:00
const-qualify the address argument to dladdr
this agrees with implementation practice on glibc and BSD systems, and is the const-correct way to do things; it eliminates warnings from passing pointers to const. the prototype without const came from seemingly erroneous man pages.
This commit is contained in:
parent
1e7a581ad6
commit
839cc4e6da
@ -31,7 +31,7 @@ typedef struct {
|
|||||||
const char *dli_sname;
|
const char *dli_sname;
|
||||||
void *dli_saddr;
|
void *dli_saddr;
|
||||||
} Dl_info;
|
} Dl_info;
|
||||||
int dladdr(void *, Dl_info *);
|
int dladdr(const void *, Dl_info *);
|
||||||
int dlinfo(void *, int, void *);
|
int dlinfo(void *, int, void *);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
#define _GNU_SOURCE
|
#define _GNU_SOURCE
|
||||||
#include <dlfcn.h>
|
#include <dlfcn.h>
|
||||||
|
|
||||||
int __dladdr(void *, Dl_info *);
|
int __dladdr(const void *, Dl_info *);
|
||||||
|
|
||||||
int dladdr(void *addr, Dl_info *info)
|
int dladdr(const void *addr, Dl_info *info)
|
||||||
{
|
{
|
||||||
return __dladdr(addr, info);
|
return __dladdr(addr, info);
|
||||||
}
|
}
|
||||||
|
@ -1331,7 +1331,7 @@ failed:
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int __dladdr(void *addr, Dl_info *info)
|
int __dladdr(const void *addr, Dl_info *info)
|
||||||
{
|
{
|
||||||
struct dso *p;
|
struct dso *p;
|
||||||
Sym *sym;
|
Sym *sym;
|
||||||
@ -1441,7 +1441,7 @@ void *__dlsym(void *restrict p, const char *restrict s, void *restrict ra)
|
|||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
int __dladdr (void *addr, Dl_info *info)
|
int __dladdr (const void *addr, Dl_info *info)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user