From 65bf5fa3172ab9d77fd1792fae68ad85eed2a7b1 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Tue, 12 Dec 1995 02:42:14 +0000 Subject: Regenerated Fri Dec 8 13:04:51 1995 Roland McGrath * posix/glob.c: Implement new options GLOB_ALTDIRFUNC, GLOB_BRACE, GLOB_TILDE, GLOB_NOMAGIC. (glob): Use stat instead of lstat to determine directoriness. * posix/glob.h (GLOB_ALTDIRFUNC, GLOB_BRACE, GLOB_NOMAGIC, GLOB_TILDE): New flag bits. (__GLOB_FLAGS): Include them. (glob_t): New members gl_closedir, gl_readdir, gl_opendir, gl_lstat, gl_stat. --- elf/dl-init.c | 5 +++-- elf/rtld.c | 4 ++-- posix/glob/ChangeLog | 11 +++++++++++ sysdeps/mach/hurd/mmap.c | 34 ++++++++++++++++++++++++++++------ 4 files changed, 44 insertions(+), 10 deletions(-) diff --git a/elf/dl-init.c b/elf/dl-init.c index c44a73f29b..7375c5f782 100644 --- a/elf/dl-init.c +++ b/elf/dl-init.c @@ -62,7 +62,8 @@ _dl_init_next (void) } } - if (l->l_info[DT_INIT]) + if (l->l_info[DT_INIT] && + !(l->l_name[0] == '\0' && l->l_type == lt_executable)) { /* Run this object's initializer. */ l->l_init_running = 1; @@ -76,7 +77,7 @@ _dl_init_next (void) } /* Look for the first initializer not yet called. */ - l = _dl_loaded->l_next; /* Skip the executable itself. */ + l = _dl_loaded; do { init = next_init (l); diff --git a/elf/rtld.c b/elf/rtld.c index 62d6488767..f91ffc77ef 100644 --- a/elf/rtld.c +++ b/elf/rtld.c @@ -182,8 +182,7 @@ of this helper program; chances are you did not intend to run this program.\n", l = _dl_map_object (NULL, _dl_argv[0]); phdr = l->l_phdr; phent = l->l_phnum; - l->l_type = lt_executable; - l->l_libname = (char *) ""; + l->l_name = (char *) ""; *user_entry = l->l_entry; } else @@ -270,6 +269,7 @@ of this helper program; chances are you did not intend to run this program.\n", { struct link_map *new; new = _dl_map_object (l, strtab + d->d_un.d_val); + new->l_type = lt_library; if (!before_rtld && new == &rtld_map) before_rtld = last; last = new; diff --git a/posix/glob/ChangeLog b/posix/glob/ChangeLog index 11e57301e6..3f75b7f2a0 100644 --- a/posix/glob/ChangeLog +++ b/posix/glob/ChangeLog @@ -1,3 +1,14 @@ +Fri Dec 8 13:04:51 1995 Roland McGrath + + * posix/glob.c: Implement new options GLOB_ALTDIRFUNC, GLOB_BRACE, + GLOB_TILDE, GLOB_NOMAGIC. + (glob): Use stat instead of lstat to determine directoriness. + * posix/glob.h (GLOB_ALTDIRFUNC, GLOB_BRACE, GLOB_NOMAGIC, GLOB_TILDE): + New flag bits. + (__GLOB_FLAGS): Include them. + (glob_t): New members gl_closedir, gl_readdir, gl_opendir, gl_lstat, + gl_stat. + Mon Sep 11 14:00:14 1995 Roland McGrath * posix/glob.c (glob): Comment fix. diff --git a/sysdeps/mach/hurd/mmap.c b/sysdeps/mach/hurd/mmap.c index 0ef847f7c2..f42c4e55c3 100644 --- a/sysdeps/mach/hurd/mmap.c +++ b/sysdeps/mach/hurd/mmap.c @@ -38,6 +38,22 @@ __mmap (caddr_t addr, size_t len, int prot, int flags, int fd, off_t offset) vm_prot_t vmprot; memory_object_t memobj; vm_address_t mapaddr; + vm_size_t pageoff; + + pageoff = offset & (vm_page_size - 1); + offset &= ~(vm_page_size - 1); + + mapaddr = (vm_address_t) addr; + if (flags & MAP_FIXED) + { + /* A specific address is requested. It need not be page-aligned; + it just needs to be congruent with the object offset. */ + if ((mapaddr & (vm_page_size - 1)) != pageoff) + return (caddr_t) (long int) __hurd_fail (EINVAL); + else + /* We will add back PAGEOFF after mapping. */ + mapaddr -= pageoff; + } vmprot = VM_PROT_NONE; if (prot & PROT_READ) @@ -100,16 +116,16 @@ __mmap (caddr_t addr, size_t len, int prot, int flags, int fd, off_t offset) } } - mapaddr = (vm_address_t) addr; + /* XXX handle MAP_INHERIT */ + err = __vm_map (__mach_task_self (), &mapaddr, (vm_size_t) len, (vm_address_t) 0, ! (flags & MAP_FIXED), memobj, (vm_offset_t) offset, - flags & (MAP_COPY|MAP_PRIVATE), + ! (flags & MAP_SHARED), vmprot, VM_PROT_ALL, - (flags & MAP_INHERIT) == 0 ? VM_INHERIT_NONE : - (flags & (MAP_COPY|MAP_PRIVATE)) ? VM_INHERIT_COPY : - VM_INHERIT_SHARE); + (flags & MAP_SHARED) ? VM_INHERIT_SHARE : VM_INHERIT_COPY); + if (err == KERN_NO_SPACE && (flags & MAP_FIXED)) { /* XXX this is not atomic as it is in unix! */ @@ -129,7 +145,13 @@ __mmap (caddr_t addr, size_t len, int prot, int flags, int fd, off_t offset) if (memobj != MACH_PORT_NULL) __mach_port_deallocate (__mach_task_self (), memobj); - return err ? (caddr_t) (long int) __hurd_fail (err) : (caddr_t) mapaddr; + if (err) + return (caddr_t) (long int) __hurd_fail (err); + + /* Adjust the mapping address for the offset-within-page. */ + mapaddr += pageoff; + + return (caddr_t) mapaddr; } weak_alias (__mmap, mmap) -- cgit v1.2.1