diff options
author | Mystery Man <unknown@mandriva.org> | 2004-07-15 06:27:30 +0000 |
---|---|---|
committer | Mystery Man <unknown@mandriva.org> | 2004-07-15 06:27:30 +0000 |
commit | 9a047aaee6ce50ac6f4ed6f51f590764c4a8c4c2 (patch) | |
tree | b5ddf2e127d03e3a0f8fbf0caded464da2ed447c /mdk-stage1/dietlibc/libdl/_dl_alloc.c | |
parent | 416a326f1fc775511cf1eac2c04cca2a69d9961a (diff) | |
download | drakx-backup-do-not-use-9a047aaee6ce50ac6f4ed6f51f590764c4a8c4c2.tar drakx-backup-do-not-use-9a047aaee6ce50ac6f4ed6f51f590764c4a8c4c2.tar.gz drakx-backup-do-not-use-9a047aaee6ce50ac6f4ed6f51f590764c4a8c4c2.tar.bz2 drakx-backup-do-not-use-9a047aaee6ce50ac6f4ed6f51f590764c4a8c4c2.tar.xz drakx-backup-do-not-use-9a047aaee6ce50ac6f4ed6f51f590764c4a8c4c2.zip |
This commit was manufactured by cvs2svn to create tag 'V10_54mdk'.V10_54mdk
Diffstat (limited to 'mdk-stage1/dietlibc/libdl/_dl_alloc.c')
-rw-r--r-- | mdk-stage1/dietlibc/libdl/_dl_alloc.c | 81 |
1 files changed, 0 insertions, 81 deletions
diff --git a/mdk-stage1/dietlibc/libdl/_dl_alloc.c b/mdk-stage1/dietlibc/libdl/_dl_alloc.c deleted file mode 100644 index 41d0d4671..000000000 --- a/mdk-stage1/dietlibc/libdl/_dl_alloc.c +++ /dev/null @@ -1,81 +0,0 @@ -#include <stdlib.h> -#include <unistd.h> -#include <sys/mman.h> - -#include "_dl_int.h" - -#ifdef __DIET_LD_SO__ -static struct _dl_handle*_dl_root_handle=(struct _dl_handle*)0; -static struct _dl_handle*_dl_top_handle=(struct _dl_handle*)0; -static struct _dl_handle*_dl_free_list=(struct _dl_handle*)0; -#else -struct _dl_handle*_dl_root_handle=(struct _dl_handle*)0; -struct _dl_handle*_dl_top_handle=(struct _dl_handle*)0; -struct _dl_handle*_dl_free_list=(struct _dl_handle*)0; -#endif - -#ifdef __DIET_LD_SO__ -static -#endif -void _dl_free_handle(struct _dl_handle*dh) { - if (_dl_root_handle==dh) _dl_root_handle=dh->next; - if (_dl_top_handle ==dh) _dl_top_handle=dh->prev; - - if (dh->next) dh->next->prev=dh->prev; - if (dh->prev) dh->prev->next=dh->next; - - if ((dh->flags&RTLD_NOSONAME) && dh->name) free(dh->name); - memset(dh,0,sizeof(struct _dl_handle)); - dh->next=_dl_free_list; - _dl_free_list=dh; -} - -#ifdef __DIET_LD_SO__ -static -#endif -struct _dl_handle*_dl_get_handle() { - struct _dl_handle*tmp; - - if (_dl_free_list==0) { - register int i,m; -#ifdef __DIET_LD_SO__ - tmp = (struct _dl_handle*)_dl_sys_mmap(0,at_pagesize,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANONYMOUS,-1,0); - m=at_pagesize/sizeof(struct _dl_handle); -#else - int ps=getpagesize(); - tmp = (struct _dl_handle*)mmap(0,ps,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANONYMOUS,-1,0); - m=ps/sizeof(struct _dl_handle); -#endif - for (i=m;i;) _dl_free_handle(tmp+(--i)); - } - - tmp = _dl_free_list; - _dl_free_list = tmp->next; - - tmp->next=0; - if (_dl_root_handle) { - _dl_top_handle->next=tmp; - tmp->prev=_dl_top_handle; - } else - _dl_root_handle = tmp; - - _dl_top_handle=tmp; - - return tmp; -} - -#ifdef __DIET_LD_SO__ -static -#endif -struct _dl_handle*_dl_find_lib(const char* name) { - if (name) { - if (_dl_root_handle) { - struct _dl_handle*tmp; - for (tmp=_dl_root_handle;tmp;tmp=tmp->next) { - if (!tmp->name) continue; - if (!strcmp(tmp->name,name)) return tmp; - } - } - } - return 0; -} |