]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Regenerated
authorRoland McGrath <roland@gnu.org>
Tue, 12 Dec 1995 02:42:14 +0000 (02:42 +0000)
committerRoland McGrath <roland@gnu.org>
Tue, 12 Dec 1995 02:42:14 +0000 (02:42 +0000)
Fri Dec  8 13:04:51 1995  Roland McGrath  <roland@churchy.gnu.ai.mit.edu>

* 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
elf/rtld.c
posix/glob/ChangeLog
sysdeps/mach/hurd/mmap.c

index c44a73f29be37b847160a7adda65349b42ef2f63..7375c5f7828955eaf20880fbe38cff6cd32da5cd 100644 (file)
@@ -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);
index 62d6488767efbe41548a17672e8f771cfc0c3f2e..f91ffc77ef452e04693e98974641c02caea06860 100644 (file)
@@ -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;
index 11e57301e66ad19a2fc0f50d57c7cb7e0b9849f8..3f75b7f2a0da9669f6997dc3d3073543355998ed 100644 (file)
@@ -1,3 +1,14 @@
+Fri Dec  8 13:04:51 1995  Roland McGrath  <roland@churchy.gnu.ai.mit.edu>
+
+       * 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  <roland@whiz-bang.gnu.ai.mit.edu>
 
        * posix/glob.c (glob): Comment fix.
index 0ef847f7c2d1069799db85ea690bdd6c26a5a679..f42c4e55c38fea6caa8bf21239848b5c0f115baf 100644 (file)
@@ -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)