libstrace_a_CPPFLAGS = $(strace_CPPFLAGS)
libstrace_a_CFLAGS = $(strace_CFLAGS)
libstrace_a_SOURCES = \
+ fstatfs.c \
+ fstatfs64.c \
+ statfs.c \
+ statfs64.c \
sync_file_range.c \
sync_file_range2.c \
upeek.c \
fcntl.c \
fetch_seccomp_fprog.c \
fetch_struct_flock.c \
+ fetch_struct_statfs.c \
file.c \
file_handle.c \
flock.c \
print_mq_attr.c \
print_msgbuf.c \
print_sigevent.c \
+ print_statfs.c \
print_time.c \
print_timex.c \
printmode.c \
socketutils.c \
sram_alloc.c \
statfs.c \
+ statfs.h \
strace.c \
swapon.c \
syscall.c \
* Implemented simultaneous use of -p option and tracing of a command.
(addresses Debian bug #549942).
* Enhanced decoding of personality, sched_getaffinity,
- and sched_setaffinity syscalls.
+ sched_setaffinity, statfs, statfs64, fstatfs, and fstatfs64 syscalls.
* Enhanced decoding of getxpid, getxuid, and getxgid syscalls on alpha.
* Added decoding of bind, listen, and setsockopt direct syscalls on sparc.
* Implemented caching of netlink conversations to reduce amount of time
[#include <sys/types.h>
#include <asm/stat.h>])
-AC_CHECK_TYPES([struct statfs64],,, [#include <sys/vfs.h>])
-
AC_CHECK_TYPES(m4_normalize([
struct pt_all_user_regs,
struct ia64_fpreg,
sys/sem.h
sys/shm.h
sys/signalfd.h
- sys/vfs.h
sys/xattr.h
]))
fi
])
+AC_CHECK_TYPES([struct statfs], [
+ AC_CHECK_MEMBERS([struct statfs.f_frsize],,, [#include <linux/types.h>
+#include <asm/statfs.h>])
+ AC_CHECK_MEMBERS([struct statfs.f_flags],,, [#include <linux/types.h>
+#include <asm/statfs.h>])
+ AC_CHECK_MEMBERS([struct statfs.f_fsid.val],,, [#include <linux/types.h>
+#include <asm/statfs.h>])
+ AC_CHECK_MEMBERS([struct statfs.f_fsid.__val],,, [#include <linux/types.h>
+#include <asm/statfs.h>])
+],, [#include <linux/types.h>
+#include <asm/statfs.h>])
+
+AC_CHECK_TYPES([struct statfs64], [
+ AC_CHECK_MEMBERS([struct statfs64.f_frsize],,, [#include <linux/types.h>
+#include <asm/statfs.h>])
+ AC_CHECK_MEMBERS([struct statfs64.f_flags],,, [#include <linux/types.h>
+#include <asm/statfs.h>])
+ AC_CHECK_MEMBERS([struct statfs64.f_fsid.val],,, [#include <linux/types.h>
+#include <asm/statfs.h>])
+ AC_CHECK_MEMBERS([struct statfs64.f_fsid.__val],,, [#include <linux/types.h>
+#include <asm/statfs.h>])
+],, [#include <linux/types.h>
+#include <asm/statfs.h>])
+
AC_CHECK_DECLS([sys_errlist])
AC_CHECK_DECLS(m4_normalize([
PTRACE_PEEKUSER,
extern const char *sprint_open_modes(int);
extern void print_seccomp_filter(struct tcb *tcp, unsigned long);
+struct strace_statfs;
+extern void print_struct_statfs(struct tcb *tcp, long);
+extern void print_struct_statfs64(struct tcb *tcp, long, unsigned long);
+
extern int block_ioctl(struct tcb *, const unsigned int, long);
extern int evdev_ioctl(struct tcb *, const unsigned int, long);
extern int loop_ioctl(struct tcb *, const unsigned int, long);
--- /dev/null
+/*
+ * Copyright (c) 2014-2016 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "defs.h"
+
+#include DEF_MPERS_TYPE(struct_statfs)
+#include DEF_MPERS_TYPE(struct_statfs64)
+
+#include <linux/types.h>
+#include <asm/statfs.h>
+typedef struct statfs struct_statfs;
+typedef struct statfs64 struct_statfs64;
+
+#include MPERS_DEFS
+
+#include "statfs.h"
+
+#define ASSIGN_NUMBER(dst, src) \
+ if (sizeof(src) == sizeof(int)) \
+ dst = (unsigned int) (src); \
+ else if (sizeof(src) == sizeof(long)) \
+ dst = (unsigned long) (src); \
+ else \
+ dst = (unsigned long long) (src)
+
+MPERS_PRINTER_DECL(bool, fetch_struct_statfs)(struct tcb *tcp, const long addr, struct strace_statfs *p)
+{
+ struct_statfs b;
+
+ if (umove_or_printaddr(tcp, addr, &b))
+ return false;
+
+ ASSIGN_NUMBER(p->f_type, b.f_type);
+ ASSIGN_NUMBER(p->f_bsize, b.f_bsize);
+ ASSIGN_NUMBER(p->f_blocks, b.f_blocks);
+ ASSIGN_NUMBER(p->f_bfree, b.f_bfree);
+ ASSIGN_NUMBER(p->f_bavail, b.f_bavail);
+ ASSIGN_NUMBER(p->f_files, b.f_files);
+ ASSIGN_NUMBER(p->f_ffree, b.f_ffree);
+#if defined HAVE_STRUCT_STATFS_F_FSID_VAL
+ ASSIGN_NUMBER(p->f_fsid[0], b.f_fsid.val[0]);
+ ASSIGN_NUMBER(p->f_fsid[1], b.f_fsid.val[1]);
+#elif defined HAVE_STRUCT_STATFS_F_FSID___VAL
+ ASSIGN_NUMBER(p->f_fsid[0], b.f_fsid.__val[0]);
+ ASSIGN_NUMBER(p->f_fsid[1], b.f_fsid.__val[1]);
+#endif
+ ASSIGN_NUMBER(p->f_namelen, b.f_namelen);
+#ifdef HAVE_STRUCT_STATFS_F_FRSIZE
+ ASSIGN_NUMBER(p->f_frsize, b.f_frsize);
+#endif
+#ifdef HAVE_STRUCT_STATFS_F_FLAGS
+ ASSIGN_NUMBER(p->f_flags, b.f_flags);
+#endif
+
+ return true;
+}
+
+#if defined ARM || (defined AARCH64 && defined IN_MPERS)
+/* See arch/arm/kernel/sys_oabi-compat.c for details. */
+# define COMPAT_STATFS64_PADDED_SIZE (sizeof(struct_statfs64) + 4)
+#endif
+
+MPERS_PRINTER_DECL(bool, fetch_struct_statfs64)(struct tcb *tcp, const long addr, const unsigned long size, struct strace_statfs *p)
+{
+ struct_statfs64 b;
+
+ if (sizeof(b) != size
+#ifdef COMPAT_STATFS64_PADDED_SIZE
+ && sizeof(b) != COMPAT_STATFS64_PADDED_SIZE
+#endif
+ ) {
+ printaddr(addr);
+ return false;
+ }
+
+ if (umove_or_printaddr(tcp, addr, &b))
+ return false;
+
+ ASSIGN_NUMBER(p->f_type, b.f_type);
+ ASSIGN_NUMBER(p->f_bsize, b.f_bsize);
+ ASSIGN_NUMBER(p->f_blocks, b.f_blocks);
+ ASSIGN_NUMBER(p->f_bfree, b.f_bfree);
+ ASSIGN_NUMBER(p->f_bavail, b.f_bavail);
+ ASSIGN_NUMBER(p->f_files, b.f_files);
+ ASSIGN_NUMBER(p->f_ffree, b.f_ffree);
+#if defined HAVE_STRUCT_STATFS64_F_FSID_VAL
+ ASSIGN_NUMBER(p->f_fsid[0], b.f_fsid.val[0]);
+ ASSIGN_NUMBER(p->f_fsid[1], b.f_fsid.val[1]);
+#elif defined HAVE_STRUCT_STATFS64_F_FSID___VAL
+ ASSIGN_NUMBER(p->f_fsid[0], b.f_fsid.__val[0]);
+ ASSIGN_NUMBER(p->f_fsid[1], b.f_fsid.__val[1]);
+#endif
+ ASSIGN_NUMBER(p->f_namelen, b.f_namelen);
+#ifdef HAVE_STRUCT_STATFS64_F_FRSIZE
+ ASSIGN_NUMBER(p->f_frsize, b.f_frsize);
+#endif
+#ifdef HAVE_STRUCT_STATFS64_F_FLAGS
+ ASSIGN_NUMBER(p->f_flags, b.f_flags);
+#endif
+
+ return true;
+}
--- /dev/null
+#include "defs.h"
+
+SYS_FUNC(fstatfs)
+{
+ if (entering(tcp)) {
+ printfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ } else {
+ print_struct_statfs(tcp, tcp->u_arg[1]);
+ }
+ return 0;
+}
--- /dev/null
+#include "defs.h"
+
+SYS_FUNC(fstatfs64)
+{
+ const unsigned long size = tcp->u_arg[1];
+
+ if (entering(tcp)) {
+ printfd(tcp, tcp->u_arg[0]);
+ tprintf(", %lu, ", size);
+ } else {
+ print_struct_statfs64(tcp, tcp->u_arg[2], size);
+ }
+ return 0;
+}
--- /dev/null
+/*
+ * Copyright (c) 2014-2016 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "defs.h"
+#include "statfs.h"
+#include "xlat/fsmagic.h"
+#include "xlat/statfs_flags.h"
+
+static void
+print_statfs_type(const char *const prefix, const unsigned long long magic)
+{
+ tprints(prefix);
+ const char *s = xlat_search(fsmagic, ARRAY_SIZE(fsmagic), magic);
+ if (s)
+ tprints(s);
+ else
+ tprintf("%#llx", magic);
+}
+
+static void
+print_statfs_flags(const char *const prefix, const unsigned long long flags)
+{
+ if (flags & ST_VALID) {
+ tprints(prefix);
+ printflags(statfs_flags, flags, "ST_???");
+ }
+}
+
+static void
+print_statfs_number(const char *const prefix, const unsigned long long number)
+{
+ tprints(prefix);
+ tprintf("%llu", number);
+}
+
+void
+print_struct_statfs(struct tcb *tcp, const long addr)
+{
+#ifdef HAVE_STRUCT_STATFS
+ struct strace_statfs b;
+
+ if (!fetch_struct_statfs(tcp, addr, &b))
+ return;
+
+ print_statfs_type("{f_type=", b.f_type);
+ print_statfs_number(", f_bsize=", b.f_bsize);
+ print_statfs_number(", f_blocks=", b.f_blocks);
+ print_statfs_number(", f_bfree=", b.f_bfree);
+ print_statfs_number(", f_bavail=", b.f_bavail);
+ print_statfs_number(", f_files=", b.f_files);
+ print_statfs_number(", f_ffree=", b.f_ffree);
+# if defined HAVE_STRUCT_STATFS_F_FSID_VAL \
+ || defined HAVE_STRUCT_STATFS_F_FSID___VAL
+ print_statfs_number(", f_fsid={", b.f_fsid[0]);
+ print_statfs_number(", ", b.f_fsid[1]);
+ tprints("}");
+# endif
+ print_statfs_number(", f_namelen=", b.f_namelen);
+# ifdef HAVE_STRUCT_STATFS_F_FRSIZE
+ print_statfs_number(", f_frsize=", b.f_frsize);
+# endif
+# ifdef HAVE_STRUCT_STATFS_F_FLAGS
+ print_statfs_flags(", f_flags=", b.f_flags);
+# endif
+ tprints("}");
+#else
+ printaddr(addr);
+#endif
+}
+
+void
+print_struct_statfs64(struct tcb *tcp, const long addr, const unsigned long size)
+{
+#ifdef HAVE_STRUCT_STATFS64
+ struct strace_statfs b;
+
+ if (!fetch_struct_statfs64(tcp, addr, size, &b))
+ return;
+
+ print_statfs_type("{f_type=", b.f_type);
+ print_statfs_number(", f_bsize=", b.f_bsize);
+ print_statfs_number(", f_blocks=", b.f_blocks);
+ print_statfs_number(", f_bfree=", b.f_bfree);
+ print_statfs_number(", f_bavail=", b.f_bavail);
+ print_statfs_number(", f_files=", b.f_files);
+ print_statfs_number(", f_ffree=", b.f_ffree);
+# if defined HAVE_STRUCT_STATFS64_F_FSID_VAL \
+ || defined HAVE_STRUCT_STATFS64_F_FSID___VAL
+ print_statfs_number(", f_fsid={", b.f_fsid[0]);
+ print_statfs_number(", ", b.f_fsid[1]);
+ tprints("}");
+# endif
+ print_statfs_number(", f_namelen=", b.f_namelen);
+# ifdef HAVE_STRUCT_STATFS64_F_FRSIZE
+ print_statfs_number(", f_frsize=", b.f_frsize);
+# endif
+# ifdef HAVE_STRUCT_STATFS64_F_FLAGS
+ print_statfs_flags(", f_flags=", b.f_flags);
+# endif
+ tprints("}");
+#else
+ printaddr(addr);
+#endif
+}
-/*
- * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
- * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
- * Copyright (c) 1993-1996 Rick Sladkey <jrs@world.std.com>
- * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
- * Copyright (c) 2003 Ulrich Drepper <drepper@redhat.com>
- * Copyright (c) 2012 Andreas Schwab <schwab@linux-m68k.org>
- * Copyright (c) 2014-2015 Dmitry V. Levin <ldv@altlinux.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
#include "defs.h"
-#ifdef HAVE_SYS_VFS_H
-# include <sys/vfs.h>
-#endif
-#include "xlat/fsmagic.h"
-#include "xlat/statfs_flags.h"
-
-static const char *
-sprintfstype(const unsigned int magic)
-{
- static char buf[32];
- const char *s;
-
- s = xlat_search(fsmagic, ARRAY_SIZE(fsmagic), magic);
- if (s)
- return s;
- sprintf(buf, "%#x", magic);
- return buf;
-}
-
-static void
-print_statfs_flags(const char *const prefix, const unsigned int flags)
-{
- if (flags & ST_VALID) {
- tprints(prefix);
- printflags(statfs_flags, flags, "ST_???");
- }
-}
-
-static void
-printstatfs(struct tcb *tcp, const long addr)
-{
- struct statfs statbuf;
-
- if (umove_or_printaddr(tcp, addr, &statbuf))
- return;
- tprintf("{f_type=%s, f_bsize=%lu, f_blocks=%lu, f_bfree=%lu, ",
- sprintfstype(statbuf.f_type),
- (unsigned long)statbuf.f_bsize,
- (unsigned long)statbuf.f_blocks,
- (unsigned long)statbuf.f_bfree);
- tprintf("f_bavail=%lu, f_files=%lu, f_ffree=%lu, f_fsid={%d, %d}",
- (unsigned long)statbuf.f_bavail,
- (unsigned long)statbuf.f_files,
- (unsigned long)statbuf.f_ffree,
- statbuf.f_fsid.__val[0], statbuf.f_fsid.__val[1]);
- tprintf(", f_namelen=%lu", (unsigned long)statbuf.f_namelen);
-#ifdef _STATFS_F_FRSIZE
- tprintf(", f_frsize=%lu", (unsigned long)statbuf.f_frsize);
-#endif
-#ifdef _STATFS_F_FLAGS
- print_statfs_flags(", f_flags=", statbuf.f_flags);
-#endif
- tprints("}");
-}
SYS_FUNC(statfs)
{
printpath(tcp, tcp->u_arg[0]);
tprints(", ");
} else {
- printstatfs(tcp, tcp->u_arg[1]);
+ print_struct_statfs(tcp, tcp->u_arg[1]);
}
return 0;
}
-
-SYS_FUNC(fstatfs)
-{
- if (entering(tcp)) {
- printfd(tcp, tcp->u_arg[0]);
- tprints(", ");
- } else {
- printstatfs(tcp, tcp->u_arg[1]);
- }
- return 0;
-}
-
-#ifdef HAVE_STRUCT_STATFS64
-static void
-printstatfs64(struct tcb *tcp, long addr)
-{
- struct statfs64 statbuf;
-
- if (umove_or_printaddr(tcp, addr, &statbuf))
- return;
- tprintf("{f_type=%s, f_bsize=%llu, f_blocks=%llu, f_bfree=%llu, ",
- sprintfstype(statbuf.f_type),
- (unsigned long 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);
-#ifdef _STATFS_F_FRSIZE
- tprintf(", f_frsize=%llu", (unsigned long long)statbuf.f_frsize);
-#endif
-#ifdef _STATFS_F_FLAGS
- print_statfs_flags(", f_flags=", statbuf.f_flags);
-#endif
- 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 AARCH64 || defined X86_64 || defined X32 || defined IA64
- ATTRIBUTE_PACKED ATTRIBUTE_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)
-{
- struct compat_statfs64 statbuf;
-
- if (umove_or_printaddr(tcp, addr, &statbuf))
- 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);
- print_statfs_flags(", f_flags=", statbuf.f_flags);
- tprints("}");
-}
-
-static int
-do_statfs64_fstatfs64(struct tcb *tcp)
-{
- if (entering(tcp)) {
- 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)
-#ifdef COMPAT_STATFS64_PADDED_SIZE
- || tcp->u_arg[1] == COMPAT_STATFS64_PADDED_SIZE
-#endif
- )
- printcompat_statfs64(tcp, tcp->u_arg[2]);
- else
- tprints("{???}");
- }
- return 0;
-}
-
-SYS_FUNC(statfs64)
-{
- if (entering(tcp))
- printpath(tcp, tcp->u_arg[0]);
- return do_statfs64_fstatfs64(tcp);
-}
-
-SYS_FUNC(fstatfs64)
-{
- if (entering(tcp))
- printfd(tcp, tcp->u_arg[0]);
- return do_statfs64_fstatfs64(tcp);
-}
-#endif /* HAVE_STRUCT_STATFS64 */
--- /dev/null
+/*
+ * Copyright (c) 2016 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef STRACE_STATFS_H
+#define STRACE_STATFS_H
+
+struct strace_statfs {
+ unsigned long long f_type;
+ unsigned long long f_bsize;
+ unsigned long long f_blocks;
+ unsigned long long f_bfree;
+ unsigned long long f_bavail;
+ unsigned long long f_files;
+ unsigned long long f_ffree;
+ unsigned long f_fsid[2];
+ unsigned long long f_namelen;
+ unsigned long long f_frsize;
+ unsigned long long f_flags;
+};
+
+#endif /* STRACE_STATFS_H */
--- /dev/null
+#include "defs.h"
+
+SYS_FUNC(statfs64)
+{
+ const unsigned long size = tcp->u_arg[1];
+
+ if (entering(tcp)) {
+ printpath(tcp, tcp->u_arg[0]);
+ tprintf(", %lu, ", size);
+ } else {
+ print_struct_statfs64(tcp, tcp->u_arg[2], size);
+ }
+ return 0;
+}
fstat
fstat64
fstatat64
+fstatfs
+fstatfs64
fsync
ftruncate
ftruncate64
stat
stat64
statfs
+statfs64
swap
symlink
symlinkat
fstat \
fstat64 \
fstatat64 \
+ fstatfs \
+ fstatfs64 \
fsync \
ftruncate \
ftruncate64 \
stat \
stat64 \
statfs \
+ statfs64 \
swap \
symlink \
symlinkat \
fstat.test \
fstat64.test \
fstatat64.test \
+ fstatfs.test \
+ fstatfs64.test \
fsync.test \
ftruncate.test \
ftruncate64.test \
stat.test \
stat64.test \
statfs.test \
+ statfs64.test \
sun_path.test \
swap.test \
symlink.test \
xattr.expected \
xchownx.c \
xselect.c \
+ xstatfs.c \
+ xstatfs64.c \
+ xstatfsx.c \
xstatx.c \
$(TESTS)
--- /dev/null
+/*
+ * Copyright (c) 2015-2016 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "tests.h"
+#include <sys/syscall.h>
+
+#ifdef __NR_fstatfs
+
+# define SYSCALL_ARG_FMT "%d"
+# define SYSCALL_ARG(file, desc) (desc)
+# define SYSCALL_NR __NR_fstatfs
+# define SYSCALL_NAME "fstatfs"
+# include "xstatfs.c"
+
+#else
+
+SKIP_MAIN_UNDEFINED("__NR_fstatfs")
+
+#endif
--- /dev/null
+#!/bin/sh
+
+# Check fstatfs syscall decoding.
+
+. "${srcdir=.}/statfs.test"
--- /dev/null
+/*
+ * Copyright (c) 2015-2016 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "tests.h"
+#include <sys/syscall.h>
+
+#ifdef __NR_fstatfs64
+
+# define SYSCALL_ARG_FMT "%d"
+# define SYSCALL_ARG(file, desc) (desc)
+# define SYSCALL_NR __NR_fstatfs64
+# define SYSCALL_NAME "fstatfs64"
+# include "xstatfs64.c"
+
+#else
+
+SKIP_MAIN_UNDEFINED("__NR_fstatfs64")
+
+#endif
--- /dev/null
+#!/bin/sh
+
+# Check fstatfs64 syscall decoding.
+
+. "${srcdir=.}/statfs.test"
*/
#include "tests.h"
-#include <sys/statfs.h>
+#include <sys/syscall.h>
-int
-main(void)
-{
- struct statfs stb;
- if (statfs("/proc/self/status", &stb))
- perror_msg_and_fail("statfs");
- return 0;
-}
+#ifdef __NR_statfs
+
+# define SYSCALL_ARG_FMT "\"%s\""
+# define SYSCALL_ARG(file, desc) (file)
+# define SYSCALL_NR __NR_statfs
+# define SYSCALL_NAME "statfs"
+# include "xstatfs.c"
+
+#else
+
+SKIP_MAIN_UNDEFINED("__NR_statfs")
+
+#endif
#!/bin/sh
-# Check how statfs/statfs64 syscalls are traced.
+# Check statfs syscall decoding.
. "${srcdir=.}/init.sh"
# this test probes /proc/self/status
[ -f /proc/self/status ] ||
- framework_skip_ '/proc/self/status is not available'
+ framework_skip_ '/proc/self/status is not available'
-run_prog
-run_strace -efile $args
-match_grep
-
-exit 0
+run_strace_match_diff -a17
--- /dev/null
+/*
+ * Copyright (c) 2015-2016 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "tests.h"
+#include <sys/syscall.h>
+
+#ifdef __NR_statfs64
+
+# define SYSCALL_ARG_FMT "\"%s\""
+# define SYSCALL_ARG(file, desc) (file)
+# define SYSCALL_NR __NR_statfs64
+# define SYSCALL_NAME "statfs64"
+# include "xstatfs64.c"
+
+#else
+
+SKIP_MAIN_UNDEFINED("__NR_statfs64")
+
+#endif
--- /dev/null
+#!/bin/sh
+
+# Check statfs64 syscall decoding.
+
+. "${srcdir=.}/statfs.test"
--- /dev/null
+/*
+ * Copyright (c) 2015-2016 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#define SYSCALL_INVOKE(file, desc, ptr, size) \
+ syscall(SYSCALL_NR, SYSCALL_ARG(file, desc), ptr)
+#define PRINT_SYSCALL_HEADER(file, desc, size) \
+ printf("%s(" SYSCALL_ARG_FMT ", ", SYSCALL_NAME, SYSCALL_ARG(file, desc))
+
+#define STRUCT_STATFS struct statfs
+#ifdef HAVE_STRUCT_STATFS_F_FRSIZE
+# define PRINT_F_FRSIZE
+#endif
+#ifdef HAVE_STRUCT_STATFS_F_FLAGS
+# define PRINT_F_FLAGS
+#endif
+#if defined HAVE_STRUCT_STATFS_F_FSID_VAL
+# define PRINT_F_FSID f_fsid.val
+#elif defined HAVE_STRUCT_STATFS_F_FSID___VAL
+# define PRINT_F_FSID f_fsid.__val
+#endif
+
+#include "xstatfsx.c"
--- /dev/null
+/*
+ * Copyright (c) 2015-2016 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#define SYSCALL_INVOKE(file, desc, ptr, size) \
+ syscall(SYSCALL_NR, SYSCALL_ARG(file, desc), size, ptr)
+#define PRINT_SYSCALL_HEADER(file, desc, size) \
+ printf("%s(" SYSCALL_ARG_FMT ", %u, ", SYSCALL_NAME, \
+ SYSCALL_ARG(file, desc), (unsigned) size)
+
+#define STRUCT_STATFS struct statfs64
+#ifdef HAVE_STRUCT_STATFS64_F_FRSIZE
+# define PRINT_F_FRSIZE
+#endif
+#ifdef HAVE_STRUCT_STATFS64_F_FLAGS
+# define PRINT_F_FLAGS
+#endif
+#if defined HAVE_STRUCT_STATFS64_F_FSID_VAL
+# define PRINT_F_FSID f_fsid.val
+#elif defined HAVE_STRUCT_STATFS64_F_FSID___VAL
+# define PRINT_F_FSID f_fsid.__val
+#endif
+#define CHECK_ODD_SIZE
+
+#include "xstatfsx.c"
--- /dev/null
+/*
+ * Copyright (c) 2015-2016 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdio.h>
+#include <fcntl.h>
+#include <unistd.h>
+
+#include <linux/types.h>
+#include <asm/statfs.h>
+
+#include "xlat.h"
+#include "xlat/fsmagic.h"
+#include "xlat/statfs_flags.h"
+
+#define PRINT_NUM(arg) \
+ if (sizeof(b->arg) == sizeof(int)) \
+ printf(", %s=%u", #arg, (unsigned int) b->arg); \
+ else if (sizeof(b->arg) == sizeof(long)) \
+ printf(", %s=%lu", #arg, (unsigned long) b->arg); \
+ else \
+ printf(", %s=%llu", #arg, (unsigned long long) b->arg)
+
+static void
+print_statfs_type(const char *const prefix, const unsigned int magic)
+{
+ fputs(prefix, stdout);
+ unsigned int i;
+ for (i = 0; i < ARRAY_SIZE(fsmagic); ++i)
+ if (magic == fsmagic[i].val) {
+ fputs(fsmagic[i].str, stdout);
+ return;
+ }
+ printf("%#x", magic);
+}
+
+static void
+print_statfs(const char *const sample, const char *magic_str)
+{
+ int fd = open(sample, O_RDONLY);
+ if (fd < 0)
+ perror_msg_and_fail("open: %s", sample);
+
+ STRUCT_STATFS *const b = tail_alloc(sizeof(*b));
+ long rc = SYSCALL_INVOKE(sample, fd, b, sizeof(*b));
+ if (rc)
+ perror_msg_and_skip(SYSCALL_NAME);
+
+ PRINT_SYSCALL_HEADER(sample, fd, sizeof(*b));
+ if (magic_str)
+ printf("{f_type=%s", magic_str);
+ else
+ print_statfs_type("{f_type=", b->f_type);
+ PRINT_NUM(f_bsize);
+ PRINT_NUM(f_blocks);
+ PRINT_NUM(f_bfree);
+ PRINT_NUM(f_bavail);
+ PRINT_NUM(f_files);
+ PRINT_NUM(f_ffree);
+#ifdef PRINT_F_FSID
+ printf(", f_fsid={%u, %u}", b->PRINT_F_FSID[0], b->PRINT_F_FSID[1]);
+#endif
+ PRINT_NUM(f_namelen);
+#ifdef PRINT_F_FRSIZE
+ PRINT_NUM(f_frsize);
+#endif
+#ifdef PRINT_F_FLAGS
+ if (b->f_flags & ST_VALID) {
+ printf(", f_flags=");
+ printflags(statfs_flags, b->f_flags, "ST_???");
+ }
+#endif
+ printf("}) = 0\n");
+}
+
+int
+main(void)
+{
+ print_statfs("/proc/self/status", "PROC_SUPER_MAGIC");
+
+ print_statfs(".", NULL);
+
+ long rc = SYSCALL_INVOKE("", -1, 0, sizeof(STRUCT_STATFS));
+ PRINT_SYSCALL_HEADER("", -1, sizeof(STRUCT_STATFS));
+ printf("NULL) = %ld %s (%m)\n", rc, errno2name());
+
+#ifdef CHECK_ODD_SIZE
+ const unsigned long addr = (unsigned long) 0xfacefeeddeadbeef;
+ rc = SYSCALL_INVOKE("", -1, addr, sizeof(STRUCT_STATFS) + 1);
+ PRINT_SYSCALL_HEADER("", -1, sizeof(STRUCT_STATFS) + 1);
+ printf("%#lx) = %ld %s (%m)\n", addr, rc, errno2name());
+#endif
+
+ puts("+++ exited with 0 +++");
+ return 0;
+}