]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - sysdeps/mach/hurd/mmap.c
Prefer https to http for gnu.org and fsf.org URLs
[thirdparty/glibc.git] / sysdeps / mach / hurd / mmap.c
index 8eb741f7e112425c96e5fa7c3e89d2f27a3e2686..1e6ab401af57e147fefa3fff6cfebb0af897cd71 100644 (file)
@@ -13,7 +13,7 @@
 
    You should have received a copy of the GNU Lesser General Public
    License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
+   <https://www.gnu.org/licenses/>.  */
 
 #include <sys/types.h>
 #include <sys/mman.h>
@@ -44,29 +44,6 @@ __mmap (void *addr, size_t len, int prot, int flags, int fd, off_t offset)
   if ((mapaddr & (__vm_page_size - 1)) || (offset & (__vm_page_size - 1)))
     return (void *) (long int) __hurd_fail (EINVAL);
 
-  if ((flags & (MAP_TYPE|MAP_INHERIT)) == MAP_ANON
-      && prot == (PROT_READ|PROT_WRITE)) /* cf VM_PROT_DEFAULT */
-    {
-      /* vm_allocate has (a little) less overhead in the kernel too.  */
-      err = __vm_allocate (__mach_task_self (), &mapaddr, len, mapaddr == 0);
-
-      if (err == KERN_NO_SPACE)
-       {
-         if (flags & MAP_FIXED)
-           {
-             /* XXX this is not atomic as it is in unix! */
-             /* The region is already allocated; deallocate it first.  */
-             err = __vm_deallocate (__mach_task_self (), mapaddr, len);
-             if (!err)
-               err = __vm_allocate (__mach_task_self (), &mapaddr, len, 0);
-           }
-         else if (mapaddr != 0)
-           err = __vm_allocate (__mach_task_self (), &mapaddr, len, 1);
-       }
-
-      return err ? (void *) (long int) __hurd_fail (err) : (void *) mapaddr;
-    }
-
   vmprot = VM_PROT_NONE;
   if (prot & PROT_READ)
     vmprot |= VM_PROT_READ;