aboutsummaryrefslogtreecommitdiff
path: root/sysdeps
diff options
context:
space:
mode:
authorAndreas Jaeger <aj@suse.de>2000-07-24 14:31:37 +0000
committerAndreas Jaeger <aj@suse.de>2000-07-24 14:31:37 +0000
commit9f4b36ca59f86315f0c4d6042face1c6721eb1ec (patch)
tree1fcf3fd1b45e9a482058ad5923897ba8a6e0e862 /sysdeps
parentcddad6b22e0d510841e226b17b1e788c12c43f83 (diff)
downloadglibc-9f4b36ca59f86315f0c4d6042face1c6721eb1ec.tar
glibc-9f4b36ca59f86315f0c4d6042face1c6721eb1ec.tar.gz
glibc-9f4b36ca59f86315f0c4d6042face1c6721eb1ec.tar.bz2
glibc-9f4b36ca59f86315f0c4d6042face1c6721eb1ec.zip
Update.
* sysdeps/unix/sysv/linux/powerpc/mmap64.c (__mmap64): Fix offset & PAGE_MASK case, reformat. * string/Makefile ($(objpfx)tst-svc.out): Fix rule to read input from stdin and setup environment.
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/mmap64.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/sysdeps/unix/sysv/linux/powerpc/mmap64.c b/sysdeps/unix/sysv/linux/powerpc/mmap64.c
index dacbbe3cf2..5b7f1c47a9 100644
--- a/sysdeps/unix/sysv/linux/powerpc/mmap64.c
+++ b/sysdeps/unix/sysv/linux/powerpc/mmap64.c
@@ -40,32 +40,33 @@ __ptr_t
__mmap64 (__ptr_t addr, size_t len, int prot, int flags, int fd, off64_t offset)
{
#ifdef __NR_mmap2
- if (
-#ifndef __ASSUME_MMAP2_SYSCALL
- ! have_no_mmap2 &&
-#endif
- ! (offset & PAGE_MASK))
+ if (! (offset & PAGE_MASK))
+ {
+ __set_errno (EINVAL);
+ return MAP_FAILED;
+ }
+
+# ifndef __ASSUME_MMAP2_SYSCALL
+ if (! have_no_mmap2)
{
-#ifndef __ASSUME_MMAP2_SYSCALL
int saved_errno = errno;
-#endif
+# endif
/* This will be always 12, no matter what page size is. */
__ptr_t result;
__ptrvalue (result) = INLINE_SYSCALL (mmap2, 6, __ptrvalue (addr), len, prot,
flags, fd, (off_t) (offset >> PAGE_SHIFT));
-#if __BOUNDED_POINTERS__
+# if __BOUNDED_POINTERS__
__ptrlow (result) = __ptrvalue (result);
__ptrhigh (result) = __ptrvalue (result) + len;
-#endif
-#ifndef __ASSUME_MMAP2_SYSCALL
+# endif
+# ifndef __ASSUME_MMAP2_SYSCALL
if (result != (__ptr_t) -1 || errno != ENOSYS)
-#endif
+# endif
return result;
-#ifndef __ASSUME_MMAP2_SYSCALL
+# ifndef __ASSUME_MMAP2_SYSCALL
__set_errno (saved_errno);
have_no_mmap2 = 1;
-#endif
}
#endif
if (offset != (off_t) offset || (offset + len) != (off_t) (offset + len))