5 #include "xlat/fsmagic.h"
8 sprintfstype(const unsigned int magic)
13 s = xlat_search(fsmagic, ARRAY_SIZE(fsmagic), magic);
15 sprintf(buf, "\"%s\"", s);
18 sprintf(buf, "%#x", magic);
23 printstatfs(struct tcb *tcp, const long addr)
25 struct statfs statbuf;
27 if (syserror(tcp) || !verbose(tcp)) {
28 tprintf("%#lx", addr);
31 if (umove(tcp, addr, &statbuf) < 0) {
35 tprintf("{f_type=%s, f_bsize=%lu, f_blocks=%lu, f_bfree=%lu, ",
36 sprintfstype(statbuf.f_type),
37 (unsigned long)statbuf.f_bsize,
38 (unsigned long)statbuf.f_blocks,
39 (unsigned long)statbuf.f_bfree);
40 tprintf("f_bavail=%lu, f_files=%lu, f_ffree=%lu, f_fsid={%d, %d}",
41 (unsigned long)statbuf.f_bavail,
42 (unsigned long)statbuf.f_files,
43 (unsigned long)statbuf.f_ffree,
44 statbuf.f_fsid.__val[0], statbuf.f_fsid.__val[1]);
45 tprintf(", f_namelen=%lu", (unsigned long)statbuf.f_namelen);
46 #ifdef _STATFS_F_FRSIZE
47 tprintf(", f_frsize=%lu", (unsigned long)statbuf.f_frsize);
53 sys_statfs(struct tcb *tcp)
56 printpath(tcp, tcp->u_arg[0]);
59 printstatfs(tcp, tcp->u_arg[1]);
65 sys_fstatfs(struct tcb *tcp)
68 printfd(tcp, tcp->u_arg[0]);
71 printstatfs(tcp, tcp->u_arg[1]);
76 #ifdef HAVE_STRUCT_STATFS64
78 printstatfs64(struct tcb *tcp, long addr)
80 struct statfs64 statbuf;
82 if (syserror(tcp) || !verbose(tcp)) {
83 tprintf("%#lx", addr);
86 if (umove(tcp, addr, &statbuf) < 0) {
90 tprintf("{f_type=%s, f_bsize=%llu, f_blocks=%llu, f_bfree=%llu, ",
91 sprintfstype(statbuf.f_type),
92 (unsigned long long)statbuf.f_bsize,
93 (unsigned long long)statbuf.f_blocks,
94 (unsigned long long)statbuf.f_bfree);
95 tprintf("f_bavail=%llu, f_files=%llu, f_ffree=%llu, f_fsid={%d, %d}",
96 (unsigned long long)statbuf.f_bavail,
97 (unsigned long long)statbuf.f_files,
98 (unsigned long long)statbuf.f_ffree,
99 statbuf.f_fsid.__val[0], statbuf.f_fsid.__val[1]);
100 tprintf(", f_namelen=%lu", (unsigned long)statbuf.f_namelen);
101 #ifdef _STATFS_F_FRSIZE
102 tprintf(", f_frsize=%llu", (unsigned long long)statbuf.f_frsize);
104 #ifdef _STATFS_F_FLAGS
105 tprintf(", f_flags=%llu", (unsigned long long)statbuf.f_flags);
110 struct compat_statfs64 {
124 #if defined(X86_64) || defined(IA64)
125 __attribute__ ((packed, aligned(4)))
130 printcompat_statfs64(struct tcb *tcp, const long addr)
132 struct compat_statfs64 statbuf;
134 if (syserror(tcp) || !verbose(tcp)) {
135 tprintf("%#lx", addr);
138 if (umove(tcp, addr, &statbuf) < 0) {
142 tprintf("{f_type=%s, f_bsize=%lu, f_blocks=%llu, f_bfree=%llu, ",
143 sprintfstype(statbuf.f_type),
144 (unsigned long)statbuf.f_bsize,
145 (unsigned long long)statbuf.f_blocks,
146 (unsigned long long)statbuf.f_bfree);
147 tprintf("f_bavail=%llu, f_files=%llu, f_ffree=%llu, f_fsid={%d, %d}",
148 (unsigned long long)statbuf.f_bavail,
149 (unsigned long long)statbuf.f_files,
150 (unsigned long long)statbuf.f_ffree,
151 statbuf.f_fsid.__val[0], statbuf.f_fsid.__val[1]);
152 tprintf(", f_namelen=%lu", (unsigned long)statbuf.f_namelen);
153 tprintf(", f_frsize=%lu", (unsigned long)statbuf.f_frsize);
154 tprintf(", f_flags=%lu}", (unsigned long)statbuf.f_frsize);
158 sys_statfs64(struct tcb *tcp)
161 printpath(tcp, tcp->u_arg[0]);
162 tprintf(", %lu, ", tcp->u_arg[1]);
164 if (tcp->u_arg[1] == sizeof(struct statfs64))
165 printstatfs64(tcp, tcp->u_arg[2]);
166 else if (tcp->u_arg[1] == sizeof(struct compat_statfs64))
167 printcompat_statfs64(tcp, tcp->u_arg[2]);
175 sys_fstatfs64(struct tcb *tcp)
178 printfd(tcp, tcp->u_arg[0]);
179 tprintf(", %lu, ", tcp->u_arg[1]);
181 if (tcp->u_arg[1] == sizeof(struct statfs64))
182 printstatfs64(tcp, tcp->u_arg[2]);
183 else if (tcp->u_arg[1] == sizeof(struct compat_statfs64))
184 printcompat_statfs64(tcp, tcp->u_arg[2]);
190 #endif /* HAVE_STRUCT_STATFS64 */
194 osf_statfs(struct tcb *tcp)
197 printpath(tcp, tcp->u_arg[0]);
200 printstatfs(tcp, tcp->u_arg[1]);
201 tprintf(", %lu", tcp->u_arg[2]);
207 osf_fstatfs(struct tcb *tcp)
210 tprintf("%lu, ", tcp->u_arg[0]);
212 printstatfs(tcp, tcp->u_arg[1]);
213 tprintf(", %lu", tcp->u_arg[2]);