]> granicus.if.org Git - strace/blobdiff - lseek.c
Print kernel_ureg_t and kernel_scno_t using dedicated format strings
[strace] / lseek.c
diff --git a/lseek.c b/lseek.c
index 708250cf49683792586c6de20db4a818e514092d..f23708e63711f9f6ce169e70a882841d9606a505 100644 (file)
--- a/lseek.c
+++ b/lseek.c
@@ -50,12 +50,12 @@ SYS_FUNC(lseek)
        printfd(tcp, tcp->u_arg[0]);
 
        long long offset;
-# if SUPPORTED_PERSONALITIES > 1
+# ifndef current_klongsize
        /* tcp->ext_arg is not initialized for compat personality */
-       if (current_personality == 1) {
+       if (current_klongsize < sizeof(*tcp->ext_arg)) {
                offset = (long) tcp->u_arg[1];
        } else
-# endif
+# endif /* !current_klongsize */
        {
                offset = tcp->ext_arg[1];
        }
@@ -72,14 +72,9 @@ SYS_FUNC(lseek)
        printfd(tcp, tcp->u_arg[0]);
 
        long offset =
-# if SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4
-#  ifdef X86_64
-               current_personality == 1 ?
-                       (long) (int) tcp->u_arg[1] : (long) tcp->u_arg[1];
-#  else
-               current_wordsize == 4 ?
+# ifndef current_klongsize
+               current_klongsize < sizeof(long) ?
                        (long) (int) tcp->u_arg[1] : (long) tcp->u_arg[1];
-#  endif
 # else
                tcp->u_arg[1];
 # endif
@@ -93,7 +88,7 @@ SYS_FUNC(lseek)
 #endif
 
 /* llseek syscall takes explicitly two ulong arguments hi, lo,
- * rather than one 64-bit argument for which LONG_LONG works
+ * rather than one 64-bit argument for which ULONG_LONG works
  * appropriate for the native byte order.
  *
  * See kernel's fs/read_write.c::SYSCALL_DEFINE5(llseek, ...)