diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2005-05-06 02:43:04 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2005-05-06 02:43:04 +0000 |
commit | 4e506c9aefe5b89970ae6894d05ad53c81af0d83 (patch) | |
tree | 2fac98df209e72eaba773cad2d7b90c99d9d9249 /mdk-stage1/dietlibc/libdl/_dl_alloc.c | |
parent | 793707b39bf2e9df40a6d2d60b83b3061088ae9e (diff) | |
download | drakx-backup-do-not-use-4e506c9aefe5b89970ae6894d05ad53c81af0d83.tar drakx-backup-do-not-use-4e506c9aefe5b89970ae6894d05ad53c81af0d83.tar.gz drakx-backup-do-not-use-4e506c9aefe5b89970ae6894d05ad53c81af0d83.tar.bz2 drakx-backup-do-not-use-4e506c9aefe5b89970ae6894d05ad53c81af0d83.tar.xz drakx-backup-do-not-use-4e506c9aefe5b89970ae6894d05ad53c81af0d83.zip |
use installed dietlibc, not our forked cvs version
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; -} |