about summary refs log tree commit diff
path: root/src/ldso/dlinfo.c
blob: 1e2c550082f645c1c057844b2d58c5abf5cace49 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#define _GNU_SOURCE
#include <dlfcn.h>
#include "libc.h"

hidden int __dl_invalid_handle(void *);

hidden void __dl_seterr(const char *, ...);

int dlinfo(void *dso, int req, void *res)
{
	if (__dl_invalid_handle(dso)) return -1;
	if (req != RTLD_DI_LINKMAP) {
		__dl_seterr("Unsupported request %d", req);
		return -1;
	}
	*(struct link_map **)res = dso;
	return 0;
}