From 9097327dc1c667fc51b8e05cc7c0626fac96665d Mon Sep 17 00:00:00 2001 From: Guillaume Cottenceau Date: Mon, 14 May 2001 14:17:54 +0000 Subject: Initial revision --- mdk-stage1/dietlibc/libdl/dlopen.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 mdk-stage1/dietlibc/libdl/dlopen.c (limited to 'mdk-stage1/dietlibc/libdl/dlopen.c') diff --git a/mdk-stage1/dietlibc/libdl/dlopen.c b/mdk-stage1/dietlibc/libdl/dlopen.c new file mode 100644 index 000000000..1693d889f --- /dev/null +++ b/mdk-stage1/dietlibc/libdl/dlopen.c @@ -0,0 +1,21 @@ +#include +#include +#include + +int _dl_search(char*buf, int bufsize, const char*filename); +void *_dl_open(const char*pathname, int fd, int flag); + +void *dlopen (const char *filename, int flag) +{ + int fd; + char buf[PATH_MAX]; + const char *p; + if (*filename=='/') + fd=open(p=filename,O_RDONLY); + else { + p=buf; + fd=_dl_search(buf,sizeof(buf),filename); + } + + return _dl_open(p,fd,flag); +} -- cgit v1.2.1