lseek: simplify _llseek syscall decoder
authorDmitry V. Levin <ldv@altlinux.org>
Mon, 26 Dec 2016 11:19:18 +0000 (11:19 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Mon, 26 Dec 2016 11:19:18 +0000 (11:19 +0000)
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.

lseek.c

diff --git a/lseek.c b/lseek.c
index 0dd439426d413ec59477a3374d76480604cc7cfc..18d847b682fffa334143d3bbf3381474a958284f 100644 (file)
--- 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(", ");