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);
49 #ifdef _STATFS_F_FLAGS
50 tprintf(", f_flags=%lu", (unsigned long)statbuf.f_flags);
58 printpath(tcp, tcp->u_arg[0]);
61 printstatfs(tcp, tcp->u_arg[1]);
69 printfd(tcp, tcp->u_arg[0]);
72 printstatfs(tcp, tcp->u_arg[1]);
77 #ifdef HAVE_STRUCT_STATFS64
79 printstatfs64(struct tcb *tcp, long addr)
81 struct statfs64 statbuf;
83 if (syserror(tcp) || !verbose(tcp)) {
84 tprintf("%#lx", addr);
87 if (umove(tcp, addr, &statbuf) < 0) {
91 tprintf("{f_type=%s, f_bsize=%llu, f_blocks=%llu, f_bfree=%llu, ",
92 sprintfstype(statbuf.f_type),
93 (unsigned long long)statbuf.f_bsize,
94 (unsigned long long)statbuf.f_blocks,
95 (unsigned long long)statbuf.f_bfree);
96 tprintf("f_bavail=%llu, f_files=%llu, f_ffree=%llu, f_fsid={%d, %d}",
97 (unsigned long long)statbuf.f_bavail,
98 (unsigned long long)statbuf.f_files,
99 (unsigned long long)statbuf.f_ffree,
100 statbuf.f_fsid.__val[0], statbuf.f_fsid.__val[1]);
101 tprintf(", f_namelen=%lu", (unsigned long)statbuf.f_namelen);
102 #ifdef _STATFS_F_FRSIZE
103 tprintf(", f_frsize=%llu", (unsigned long long)statbuf.f_frsize);
105 #ifdef _STATFS_F_FLAGS
106 tprintf(", f_flags=%llu", (unsigned long long)statbuf.f_flags);
111 struct compat_statfs64 {
125 #if defined AARCH64 || defined X86_64 || defined X32 || defined IA64
126 ATTRIBUTE_PACKED ATTRIBUTE_ALIGNED(4)
129 #if defined AARCH64 || defined ARM
130 /* See arch/arm/kernel/sys_oabi-compat.c for details. */
131 # define COMPAT_STATFS64_PADDED_SIZE (sizeof(struct compat_statfs64) + 4)
135 printcompat_statfs64(struct tcb *tcp, const long addr)
137 struct compat_statfs64 statbuf;
139 if (syserror(tcp) || !verbose(tcp)) {
140 tprintf("%#lx", addr);
143 if (umove(tcp, addr, &statbuf) < 0) {
147 tprintf("{f_type=%s, f_bsize=%lu, f_blocks=%llu, f_bfree=%llu, ",
148 sprintfstype(statbuf.f_type),
149 (unsigned long)statbuf.f_bsize,
150 (unsigned long long)statbuf.f_blocks,
151 (unsigned long long)statbuf.f_bfree);
152 tprintf("f_bavail=%llu, f_files=%llu, f_ffree=%llu, f_fsid={%d, %d}",
153 (unsigned long long)statbuf.f_bavail,
154 (unsigned long long)statbuf.f_files,
155 (unsigned long long)statbuf.f_ffree,
156 statbuf.f_fsid.__val[0], statbuf.f_fsid.__val[1]);
157 tprintf(", f_namelen=%lu", (unsigned long)statbuf.f_namelen);
158 tprintf(", f_frsize=%lu", (unsigned long)statbuf.f_frsize);
159 tprintf(", f_flags=%lu}", (unsigned long)statbuf.f_frsize);
163 do_statfs64_fstatfs64(struct tcb *tcp)
166 tprintf(", %lu, ", tcp->u_arg[1]);
168 if (tcp->u_arg[1] == sizeof(struct statfs64))
169 printstatfs64(tcp, tcp->u_arg[2]);
170 else if (tcp->u_arg[1] == sizeof(struct compat_statfs64)
171 #ifdef COMPAT_STATFS64_PADDED_SIZE
172 || tcp->u_arg[1] == COMPAT_STATFS64_PADDED_SIZE
175 printcompat_statfs64(tcp, tcp->u_arg[2]);
185 printpath(tcp, tcp->u_arg[0]);
186 return do_statfs64_fstatfs64(tcp);
192 printfd(tcp, tcp->u_arg[0]);
193 return do_statfs64_fstatfs64(tcp);
195 #endif /* HAVE_STRUCT_STATFS64 */
201 printpath(tcp, tcp->u_arg[0]);
204 printstatfs(tcp, tcp->u_arg[1]);
205 tprintf(", %lu", tcp->u_arg[2]);
210 SYS_FUNC(osf_fstatfs)
213 tprintf("%lu, ", tcp->u_arg[0]);
215 printstatfs(tcp, tcp->u_arg[1]);
216 tprintf(", %lu", tcp->u_arg[2]);