* 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.
This commit is contained in:
Andreas Jaeger 2000-07-24 14:31:37 +00:00
parent cddad6b22e
commit 9f4b36ca59
2 changed files with 19 additions and 15 deletions

View file

@ -1,7 +1,10 @@
2000-07-24 Andreas Jaeger <aj@suse.de> 2000-07-24 Andreas Jaeger <aj@suse.de>
* string/Makefile ($(objpfx)tst-svc.out): Fix rule to read from * sysdeps/unix/sysv/linux/powerpc/mmap64.c (__mmap64): Fix offset
input from stdin and setup environment. & PAGE_MASK case, reformat.
* string/Makefile ($(objpfx)tst-svc.out): Fix rule to read input
from stdin and setup environment.
2000-07-24 Andreas Schwab <schwab@suse.de> 2000-07-24 Andreas Schwab <schwab@suse.de>

View file

@ -40,32 +40,33 @@ __ptr_t
__mmap64 (__ptr_t addr, size_t len, int prot, int flags, int fd, off64_t offset) __mmap64 (__ptr_t addr, size_t len, int prot, int flags, int fd, off64_t offset)
{ {
#ifdef __NR_mmap2 #ifdef __NR_mmap2
if ( if (! (offset & PAGE_MASK))
#ifndef __ASSUME_MMAP2_SYSCALL {
! have_no_mmap2 && __set_errno (EINVAL);
#endif return MAP_FAILED;
! (offset & PAGE_MASK)) }
# ifndef __ASSUME_MMAP2_SYSCALL
if (! have_no_mmap2)
{ {
#ifndef __ASSUME_MMAP2_SYSCALL
int saved_errno = errno; int saved_errno = errno;
#endif # endif
/* This will be always 12, no matter what page size is. */ /* This will be always 12, no matter what page size is. */
__ptr_t result; __ptr_t result;
__ptrvalue (result) = INLINE_SYSCALL (mmap2, 6, __ptrvalue (addr), len, prot, __ptrvalue (result) = INLINE_SYSCALL (mmap2, 6, __ptrvalue (addr), len, prot,
flags, fd, (off_t) (offset >> PAGE_SHIFT)); flags, fd, (off_t) (offset >> PAGE_SHIFT));
#if __BOUNDED_POINTERS__ # if __BOUNDED_POINTERS__
__ptrlow (result) = __ptrvalue (result); __ptrlow (result) = __ptrvalue (result);
__ptrhigh (result) = __ptrvalue (result) + len; __ptrhigh (result) = __ptrvalue (result) + len;
#endif # endif
#ifndef __ASSUME_MMAP2_SYSCALL # ifndef __ASSUME_MMAP2_SYSCALL
if (result != (__ptr_t) -1 || errno != ENOSYS) if (result != (__ptr_t) -1 || errno != ENOSYS)
#endif # endif
return result; return result;
#ifndef __ASSUME_MMAP2_SYSCALL # ifndef __ASSUME_MMAP2_SYSCALL
__set_errno (saved_errno); __set_errno (saved_errno);
have_no_mmap2 = 1; have_no_mmap2 = 1;
#endif
} }
#endif #endif
if (offset != (off_t) offset || (offset + len) != (off_t) (offset + len)) if (offset != (off_t) offset || (offset + len) != (off_t) (offset + len))