diff options
author | Dmitry V. Levin <ldv@altlinux.org> | 2014-04-17 13:32:47 +0000 |
---|---|---|
committer | Dmitry V. Levin <ldv@altlinux.org> | 2014-04-17 13:39:49 +0000 |
commit | 7845a42b39e59e904d01e75e21f7bc7eb6462560 (patch) | |
tree | 048e6aa057d57df773be7b0f9536960323af95bf /util.c | |
parent | cc3d59199d80588a53ee353da5d69726bd093c51 (diff) | |
download | strace-7845a42b39e59e904d01e75e21f7bc7eb6462560.tar.gz strace-7845a42b39e59e904d01e75e21f7bc7eb6462560.tar.bz2 strace-7845a42b39e59e904d01e75e21f7bc7eb6462560.tar.xz |
Fix preadv/pwritev offset decoding
* util.c (printllval): Add align argument.
* defs.h (printllval): Update prototype.
(printllval_aligned, printllval_unaligned): New macros.
* file.c (sys_readahead, sys_truncate64, sys_ftruncate64, sys_fadvise64,
sys_fadvise64_64, sys_sync_file_range, sys_sync_file_range2,
sys_fallocate): Replace printllval call with printllval_aligned.
* io.c (sys_pread, sys_pwrite): Likewise.
(sys_preadv, sys_pwritev): Replace printllval call with
printllval_unaligned.
* linux/arm/syscallent.h: Set the number of preadv and pwritev
arguments to 5.
* linux/mips/syscallent-o32.h: Likewise.
* linux/powerpc/syscallent.h: Likewise.
* linux/sh/syscallent.h: Likewise.
* linux/xtensa/syscallent.h: Likewise.
Reported-by: Dima Kogan <dima@secretsauce.net>
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 14 |
1 files changed, 9 insertions, 5 deletions
@@ -225,7 +225,7 @@ printxval(const struct xlat *xlat, int val, const char *dflt) * argument. */ int -printllval(struct tcb *tcp, const char *format, int arg_no) +printllval(struct tcb *tcp, const char *format, int arg_no, bool align) { #if SIZEOF_LONG > 4 && SIZEOF_LONG == SIZEOF_LONG_LONG # if SUPPORTED_PERSONALITIES > 1 @@ -236,8 +236,10 @@ printllval(struct tcb *tcp, const char *format, int arg_no) # if SUPPORTED_PERSONALITIES > 1 } else { # if defined(AARCH64) || defined(POWERPC64) - /* Align arg_no to the next even number. */ - arg_no = (arg_no + 1) & 0xe; + if (align) { + /* Align arg_no to the next even number. */ + arg_no = (arg_no + 1) & 0xe; + } # endif tprintf(format, LONG_LONG(tcp->u_arg[arg_no], tcp->u_arg[arg_no + 1])); arg_no += 2; @@ -261,8 +263,10 @@ printllval(struct tcb *tcp, const char *format, int arg_no) defined LINUX_MIPSO32 || \ defined POWERPC || \ defined XTENSA - /* Align arg_no to the next even number. */ - arg_no = (arg_no + 1) & 0xe; + if (align) { + /* Align arg_no to the next even number. */ + arg_no = (arg_no + 1) & 0xe; + } # endif tprintf(format, LONG_LONG(tcp->u_arg[arg_no], tcp->u_arg[arg_no + 1])); arg_no += 2; |