From: Dmitry V. Levin Date: Mon, 26 Dec 2016 11:19:18 +0000 (+0000) Subject: lseek: simplify _llseek syscall decoder X-Git-Tag: v4.16~151 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5477470e9c1c0d192ddd0e301c1b636d9b86d429;p=strace lseek: simplify _llseek syscall decoder After transition from long to kernel_ulong_t the implementation could be made a bit simpler. * lseek.c (SYS_FUNC(llseek)): Use direct cast to long long instead of zero_extend_signed_to_ull. --- diff --git a/lseek.c b/lseek.c index 0dd43942..18d847b6 100644 --- a/lseek.c +++ b/lseek.c @@ -75,16 +75,15 @@ SYS_FUNC(lseek) * ((loff_t) hi << 32) | lo * Note that for architectures with kernel's long wider than userspace long * (such as x32), combining code will use *kernel's*, i.e. *wide* longs - * for hi and lo. We would need to use tcp->ext_arg[N] on x32... - * ...however, x32 (and x86_64) does not _have_ llseek syscall as such. + * for hi and lo. */ SYS_FUNC(llseek) { if (entering(tcp)) { printfd(tcp, tcp->u_arg[0]); tprintf(", %lld, ", - (zero_extend_signed_to_ull(tcp->u_arg[1]) << 32) - | zero_extend_signed_to_ull(tcp->u_arg[2])); + ((long long) tcp->u_arg[1] << 32) + | ((long long) tcp->u_arg[2])); } else { printnum_int64(tcp, tcp->u_arg[3], "%" PRIu64); tprints(", ");