Commit 4a56a7be by H.J. Lu Committed by H.J. Lu

Check __x86_64__ instead of __WORDSIZE

	PR other/55292
	Backport from upstream revision 167883
	* sanitizer_common/sanitizer_linux.cc (internal_mmap): Check
	__x86_64__ instead of __WORDSIZE.
	(internal_filesize): Likwise.

From-SVN: r193500
parent 4053ca2c
2012-11-14 H.J. Lu <hongjiu.lu@intel.com> 2012-11-14 H.J. Lu <hongjiu.lu@intel.com>
PR other/55292
Backport from upstream revision 167883
* sanitizer_common/sanitizer_linux.cc (internal_mmap): Check
__x86_64__ instead of __WORDSIZE.
(internal_filesize): Likwise.
2012-11-14 H.J. Lu <hongjiu.lu@intel.com>
* configure.ac (AC_CONFIG_AUX_DIR): Removed. * configure.ac (AC_CONFIG_AUX_DIR): Removed.
* Makefile.in: Regenerated. * Makefile.in: Regenerated.
* configure: Likewise. * configure: Likewise.
......
...@@ -34,7 +34,7 @@ namespace __sanitizer { ...@@ -34,7 +34,7 @@ namespace __sanitizer {
// --------------- sanitizer_libc.h // --------------- sanitizer_libc.h
void *internal_mmap(void *addr, uptr length, int prot, int flags, void *internal_mmap(void *addr, uptr length, int prot, int flags,
int fd, u64 offset) { int fd, u64 offset) {
#if __WORDSIZE == 64 #if defined __x86_64__
return (void *)syscall(__NR_mmap, addr, length, prot, flags, fd, offset); return (void *)syscall(__NR_mmap, addr, length, prot, flags, fd, offset);
#else #else
return (void *)syscall(__NR_mmap2, addr, length, prot, flags, fd, offset); return (void *)syscall(__NR_mmap2, addr, length, prot, flags, fd, offset);
...@@ -67,7 +67,7 @@ uptr internal_write(fd_t fd, const void *buf, uptr count) { ...@@ -67,7 +67,7 @@ uptr internal_write(fd_t fd, const void *buf, uptr count) {
} }
uptr internal_filesize(fd_t fd) { uptr internal_filesize(fd_t fd) {
#if __WORDSIZE == 64 #if defined __x86_64__
struct stat st; struct stat st;
if (syscall(__NR_fstat, fd, &st)) if (syscall(__NR_fstat, fd, &st))
return -1; return -1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment