diff options
author | Andreas Schwab <schwab@linux-m68k.org> | 2012-01-17 18:14:22 +0100 |
---|---|---|
committer | Andreas Schwab <schwab@linux-m68k.org> | 2012-01-18 21:19:25 +0100 |
commit | 7d55801ae92a83c8f3efa8c97fdeb42f036bbbb2 (patch) | |
tree | 7053f815d000f190c9082a76b65c297845aeab22 | |
parent | 000d66f17542ea1f3ca4803c3df59f99e15e89e0 (diff) | |
download | strace-7d55801ae92a83c8f3efa8c97fdeb42f036bbbb2.tar.gz |
Add support for compat_statfs64
* file.c (struct compat_statfs64, printcompat_statfs64): Define.
(sys_statfs64, sys_fstatfs64): Use it.
-rw-r--r-- | file.c | 52 |
1 files changed, 52 insertions, 0 deletions
@@ -1794,6 +1794,54 @@ printstatfs64(struct tcb *tcp, long addr) tprints("}"); } +struct compat_statfs64 { + uint32_t f_type; + uint32_t f_bsize; + uint64_t f_blocks; + uint64_t f_bfree; + uint64_t f_bavail; + uint64_t f_files; + uint64_t f_ffree; + fsid_t f_fsid; + uint32_t f_namelen; + uint32_t f_frsize; + uint32_t f_flags; + uint32_t f_spare[4]; +} +#if defined(X86_64) || defined(IA64) + __attribute__ ((packed, aligned(4))) +#endif +; + +static void +printcompat_statfs64(struct tcb *tcp, long addr) +{ + struct compat_statfs64 statbuf; + + if (syserror(tcp) || !verbose(tcp)) { + tprintf("%#lx", addr); + return; + } + if (umove(tcp, addr, &statbuf) < 0) { + tprints("{...}"); + return; + } + tprintf("{f_type=%s, f_bsize=%lu, f_blocks=%llu, f_bfree=%llu, ", + sprintfstype(statbuf.f_type), + (unsigned long)statbuf.f_bsize, + (unsigned long long)statbuf.f_blocks, + (unsigned long long)statbuf.f_bfree); + tprintf("f_bavail=%llu, f_files=%llu, f_ffree=%llu, f_fsid={%d, %d}", + (unsigned long long)statbuf.f_bavail, + (unsigned long long)statbuf.f_files, + (unsigned long long)statbuf.f_ffree, + statbuf.f_fsid.__val[0], statbuf.f_fsid.__val[1]); + tprintf(", f_namelen=%lu", (unsigned long)statbuf.f_namelen); + tprintf(", f_frsize=%lu", (unsigned long)statbuf.f_frsize); + tprintf(", f_flags=%lu", (unsigned long)statbuf.f_frsize); + tprints("}"); +} + int sys_statfs64(struct tcb *tcp) { @@ -1803,6 +1851,8 @@ sys_statfs64(struct tcb *tcp) } 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("{???}"); } @@ -1818,6 +1868,8 @@ sys_fstatfs64(struct tcb *tcp) } 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("{???}"); } |