]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Handle unaligned offsets.
authorUlrich Drepper <drepper@redhat.com>
Sun, 2 Jan 2000 20:25:30 +0000 (20:25 +0000)
committerUlrich Drepper <drepper@redhat.com>
Sun, 2 Jan 2000 20:25:30 +0000 (20:25 +0000)
sysdeps/unix/sysv/linux/i386/mmap64.S

index 5cd480b83f25a24d325c186bb322a2d62ec6bf6e..6d239a9a2ed9b5b13a201b19e672aa23c60301f1 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 96, 97, 98, 99, 2000 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -33,10 +33,10 @@ ENTRY (__mmap64)
        pushl %esi
        pushl %edi
 
-       movl $SYS_ify(mmap2), %eax      /* System call number in %eax.  */
-
        movl 40(%esp), %edx
        movl 44(%esp), %ecx
+       testl $0x3ff, %edx
+       jne L(einval)
        shrdl $12, %ecx, %edx           /* mmap2 takes the offset in pages.  */
        shrl $12, %ecx
        jne L(einval)
@@ -48,6 +48,8 @@ ENTRY (__mmap64)
        movl 32(%esp), %esi
        movl 36(%esp), %edi
 
+       movl $SYS_ify(mmap2), %eax      /* System call number in %eax.  */
+
        /* Do the system call trap.  */
 L(do_syscall):
        int $0x80