aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv/linux/i386/mmap.S
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix/sysv/linux/i386/mmap.S')
-rw-r--r--sysdeps/unix/sysv/linux/i386/mmap.S11
1 files changed, 7 insertions, 4 deletions
diff --git a/sysdeps/unix/sysv/linux/i386/mmap.S b/sysdeps/unix/sysv/linux/i386/mmap.S
index 0397f841f1..46d26125a5 100644
--- a/sysdeps/unix/sysv/linux/i386/mmap.S
+++ b/sysdeps/unix/sysv/linux/i386/mmap.S
@@ -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
@@ -36,19 +36,22 @@ ENTRY (__mmap)
pushl %esi
pushl %edi
- movl $SYS_ify(mmap2), %eax /* System call number in %eax. */
-
movl 20(%esp), %ebx
movl 24(%esp), %ecx
movl 28(%esp), %edx
movl 32(%esp), %esi
movl 36(%esp), %edi
movl 40(%esp), %ebp
+ testl $0x3ff, %ebp
+ movl $-EINVAL, %eax
+ jne L(skip)
shrl $12, %ebp /* mmap2 takes the offset in pages. */
+ movl $SYS_ify(mmap2), %eax /* System call number in %eax. */
+
/* Do the system call trap. */
int $0x80
-
+L(skip):
/* Restore registers. */
popl %edi
popl %esi