Implement decoding of fallocate FALLOC_FL_* flags
* xlat/falloc_flags.in: New file.
* configure.ac (AC_CHECK_HEADERS): Add linux/falloc.h.
* fallocate.c [HAVE_LINUX_FALLOC_H]: Include <linux/falloc.h>.
Include xlat/falloc_flags.h.
(sys_fallocate): Decode flags.
diff --git a/fallocate.c b/fallocate.c
index c906cc5..990106d 100644
--- a/fallocate.c
+++ b/fallocate.c
@@ -1,14 +1,30 @@
#include "defs.h"
+#ifdef HAVE_LINUX_FALLOC_H
+# include <linux/falloc.h>
+#endif
+
+#include "xlat/falloc_flags.h"
+
int
sys_fallocate(struct tcb *tcp)
{
if (entering(tcp)) {
int argn;
- printfd(tcp, tcp->u_arg[0]); /* fd */
- tprintf(", %#lo, ", tcp->u_arg[1]); /* mode */
- argn = printllval(tcp, "%llu, ", 2); /* offset */
- printllval(tcp, "%llu", argn); /* len */
+
+ /* fd */
+ printfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+
+ /* mode */
+ printflags(falloc_flags, tcp->u_arg[1], "FALLOC_FL_???");
+ tprints(", ");
+
+ /* offset */
+ argn = printllval(tcp, "%llu, ", 2);
+
+ /* len */
+ printllval(tcp, "%llu", argn);
}
return 0;
}