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 (umove_or_printaddr(tcp, addr, &statbuf))
29 tprintf("{f_type=%s, f_bsize=%lu, f_blocks=%lu, f_bfree=%lu, ",
30 sprintfstype(statbuf.f_type),
31 (unsigned long)statbuf.f_bsize,
32 (unsigned long)statbuf.f_blocks,
33 (unsigned long)statbuf.f_bfree);
34 tprintf("f_bavail=%lu, f_files=%lu, f_ffree=%lu, f_fsid={%d, %d}",
35 (unsigned long)statbuf.f_bavail,
36 (unsigned long)statbuf.f_files,
37 (unsigned long)statbuf.f_ffree,
38 statbuf.f_fsid.__val[0], statbuf.f_fsid.__val[1]);
39 tprintf(", f_namelen=%lu", (unsigned long)statbuf.f_namelen);
40 #ifdef _STATFS_F_FRSIZE
41 tprintf(", f_frsize=%lu", (unsigned long)statbuf.f_frsize);
43 #ifdef _STATFS_F_FLAGS
44 tprintf(", f_flags=%lu", (unsigned long)statbuf.f_flags);
52 printpath(tcp, tcp->u_arg[0]);
55 printstatfs(tcp, tcp->u_arg[1]);
63 printfd(tcp, tcp->u_arg[0]);
66 printstatfs(tcp, tcp->u_arg[1]);
71 #ifdef HAVE_STRUCT_STATFS64
73 printstatfs64(struct tcb *tcp, long addr)
75 struct statfs64 statbuf;
77 if (umove_or_printaddr(tcp, addr, &statbuf))
79 tprintf("{f_type=%s, f_bsize=%llu, f_blocks=%llu, f_bfree=%llu, ",
80 sprintfstype(statbuf.f_type),
81 (unsigned long long)statbuf.f_bsize,
82 (unsigned long long)statbuf.f_blocks,
83 (unsigned long long)statbuf.f_bfree);
84 tprintf("f_bavail=%llu, f_files=%llu, f_ffree=%llu, f_fsid={%d, %d}",
85 (unsigned long long)statbuf.f_bavail,
86 (unsigned long long)statbuf.f_files,
87 (unsigned long long)statbuf.f_ffree,
88 statbuf.f_fsid.__val[0], statbuf.f_fsid.__val[1]);
89 tprintf(", f_namelen=%lu", (unsigned long)statbuf.f_namelen);
90 #ifdef _STATFS_F_FRSIZE
91 tprintf(", f_frsize=%llu", (unsigned long long)statbuf.f_frsize);
93 #ifdef _STATFS_F_FLAGS
94 tprintf(", f_flags=%llu", (unsigned long long)statbuf.f_flags);
99 struct compat_statfs64 {
113 #if defined AARCH64 || defined X86_64 || defined X32 || defined IA64
114 ATTRIBUTE_PACKED ATTRIBUTE_ALIGNED(4)
117 #if defined AARCH64 || defined ARM
118 /* See arch/arm/kernel/sys_oabi-compat.c for details. */
119 # define COMPAT_STATFS64_PADDED_SIZE (sizeof(struct compat_statfs64) + 4)
123 printcompat_statfs64(struct tcb *tcp, const long addr)
125 struct compat_statfs64 statbuf;
127 if (umove_or_printaddr(tcp, addr, &statbuf))
129 tprintf("{f_type=%s, f_bsize=%lu, f_blocks=%llu, f_bfree=%llu, ",
130 sprintfstype(statbuf.f_type),
131 (unsigned long)statbuf.f_bsize,
132 (unsigned long long)statbuf.f_blocks,
133 (unsigned long long)statbuf.f_bfree);
134 tprintf("f_bavail=%llu, f_files=%llu, f_ffree=%llu, f_fsid={%d, %d}",
135 (unsigned long long)statbuf.f_bavail,
136 (unsigned long long)statbuf.f_files,
137 (unsigned long long)statbuf.f_ffree,
138 statbuf.f_fsid.__val[0], statbuf.f_fsid.__val[1]);
139 tprintf(", f_namelen=%lu", (unsigned long)statbuf.f_namelen);
140 tprintf(", f_frsize=%lu", (unsigned long)statbuf.f_frsize);
141 tprintf(", f_flags=%lu}", (unsigned long)statbuf.f_frsize);
145 do_statfs64_fstatfs64(struct tcb *tcp)
148 tprintf(", %lu, ", tcp->u_arg[1]);
150 if (tcp->u_arg[1] == sizeof(struct statfs64))
151 printstatfs64(tcp, tcp->u_arg[2]);
152 else if (tcp->u_arg[1] == sizeof(struct compat_statfs64)
153 #ifdef COMPAT_STATFS64_PADDED_SIZE
154 || tcp->u_arg[1] == COMPAT_STATFS64_PADDED_SIZE
157 printcompat_statfs64(tcp, tcp->u_arg[2]);
167 printpath(tcp, tcp->u_arg[0]);
168 return do_statfs64_fstatfs64(tcp);
174 printfd(tcp, tcp->u_arg[0]);
175 return do_statfs64_fstatfs64(tcp);
177 #endif /* HAVE_STRUCT_STATFS64 */
183 printpath(tcp, tcp->u_arg[0]);
186 printstatfs(tcp, tcp->u_arg[1]);
187 tprintf(", %lu", tcp->u_arg[2]);
192 SYS_FUNC(osf_fstatfs)
195 tprintf("%lu, ", tcp->u_arg[0]);
197 printstatfs(tcp, tcp->u_arg[1]);
198 tprintf(", %lu", tcp->u_arg[2]);