]> granicus.if.org Git - strace/blobdiff - statfs.c
Change last parameter of umoven() from char* to void*
[strace] / statfs.c
index d8583f6e8daa7dd4aec91da0034204e515aec0e8..214e6b2a813a29f70f20eb297eec57c127c26d26 100644 (file)
--- a/statfs.c
+++ b/statfs.c
@@ -32,15 +32,6 @@ printstatfs(struct tcb *tcp, const long addr)
                tprints("{...}");
                return;
        }
-#ifdef ALPHA
-       tprintf("{f_type=%s, f_fbsize=%u, f_blocks=%u, f_bfree=%u, ",
-               sprintfstype(statbuf.f_type),
-               statbuf.f_bsize, statbuf.f_blocks, statbuf.f_bfree);
-       tprintf("f_bavail=%u, f_files=%u, f_ffree=%u, f_fsid={%d, %d}, f_namelen=%u",
-               statbuf.f_bavail, statbuf.f_files, statbuf.f_ffree,
-               statbuf.f_fsid.__val[0], statbuf.f_fsid.__val[1],
-               statbuf.f_namelen);
-#else /* !ALPHA */
        tprintf("{f_type=%s, f_bsize=%lu, f_blocks=%lu, f_bfree=%lu, ",
                sprintfstype(statbuf.f_type),
                (unsigned long)statbuf.f_bsize,
@@ -52,9 +43,11 @@ printstatfs(struct tcb *tcp, const long addr)
                (unsigned long)statbuf.f_ffree,
                statbuf.f_fsid.__val[0], statbuf.f_fsid.__val[1]);
        tprintf(", f_namelen=%lu", (unsigned long)statbuf.f_namelen);
-#endif /* !ALPHA */
 #ifdef _STATFS_F_FRSIZE
        tprintf(", f_frsize=%lu", (unsigned long)statbuf.f_frsize);
+#endif
+#ifdef _STATFS_F_FLAGS
+       tprintf(", f_flags=%lu", (unsigned long)statbuf.f_flags);
 #endif
        tprints("}");
 }
@@ -83,7 +76,7 @@ sys_fstatfs(struct tcb *tcp)
        return 0;
 }
 
-#ifdef HAVE_STATFS64
+#ifdef HAVE_STRUCT_STATFS64
 static void
 printstatfs64(struct tcb *tcp, long addr)
 {
@@ -131,10 +124,14 @@ struct compat_statfs64 {
        uint32_t f_flags;
        uint32_t f_spare[4];
 }
-#if defined(X86_64) || defined(IA64)
+#if defined AARCH64 || defined X86_64 || defined X32 || defined IA64
   __attribute__ ((packed, aligned(4)))
 #endif
 ;
+#if defined AARCH64 || defined ARM
+/* See arch/arm/kernel/sys_oabi-compat.c for details. */
+# define COMPAT_STATFS64_PADDED_SIZE (sizeof(struct compat_statfs64) + 4)
+#endif
 
 static void
 printcompat_statfs64(struct tcb *tcp, const long addr)
@@ -164,16 +161,19 @@ printcompat_statfs64(struct tcb *tcp, const long addr)
        tprintf(", f_flags=%lu}", (unsigned long)statbuf.f_frsize);
 }
 
-int
-sys_statfs64(struct tcb *tcp)
+static int
+do_statfs64_fstatfs64(struct tcb *tcp)
 {
        if (entering(tcp)) {
-               printpath(tcp, tcp->u_arg[0]);
                tprintf(", %lu, ", tcp->u_arg[1]);
        } else {
                if (tcp->u_arg[1] == sizeof(struct statfs64))
                        printstatfs64(tcp, tcp->u_arg[2]);
-               else if (tcp->u_arg[1] == sizeof(struct compat_statfs64))
+               else if (tcp->u_arg[1] == sizeof(struct compat_statfs64)
+#ifdef COMPAT_STATFS64_PADDED_SIZE
+                        || tcp->u_arg[1] == COMPAT_STATFS64_PADDED_SIZE
+#endif
+                                                                       )
                        printcompat_statfs64(tcp, tcp->u_arg[2]);
                else
                        tprints("{???}");
@@ -181,23 +181,22 @@ sys_statfs64(struct tcb *tcp)
        return 0;
 }
 
+int
+sys_statfs64(struct tcb *tcp)
+{
+       if (entering(tcp))
+               printpath(tcp, tcp->u_arg[0]);
+       return do_statfs64_fstatfs64(tcp);
+}
+
 int
 sys_fstatfs64(struct tcb *tcp)
 {
-       if (entering(tcp)) {
+       if (entering(tcp))
                printfd(tcp, tcp->u_arg[0]);
-               tprintf(", %lu, ", tcp->u_arg[1]);
-       } else {
-               if (tcp->u_arg[1] == sizeof(struct statfs64))
-                       printstatfs64(tcp, tcp->u_arg[2]);
-               else if (tcp->u_arg[1] == sizeof(struct compat_statfs64))
-                       printcompat_statfs64(tcp, tcp->u_arg[2]);
-               else
-                       tprints("{???}");
-       }
-       return 0;
+       return do_statfs64_fstatfs64(tcp);
 }
-#endif /* HAVE_STATFS64 */
+#endif /* HAVE_STRUCT_STATFS64 */
 
 #ifdef ALPHA
 int