Convert parser of seccomp filter program to new mpers infrastructure
* seccomp_fprog.h: New file.
* fetch_seccomp_fprog.c: New file.
* Makefile.am (strace_SOURCES): Add them.
* seccomp.c: Include "seccomp_fprog.h".
(print_seccomp_filter): Use fetch_seccomp_fprog.
diff --git a/fetch_seccomp_fprog.c b/fetch_seccomp_fprog.c
new file mode 100644
index 0000000..e32366a
--- /dev/null
+++ b/fetch_seccomp_fprog.c
@@ -0,0 +1,24 @@
+#include "defs.h"
+
+#include DEF_MPERS_TYPE(seccomp_fprog_t)
+
+#include "seccomp_fprog.h"
+typedef struct seccomp_fprog seccomp_fprog_t;
+
+#include MPERS_DEFS
+
+MPERS_PRINTER_DECL(bool, fetch_seccomp_fprog)(struct tcb *tcp, const long addr, void *p)
+{
+ struct seccomp_fprog *pfp = p;
+ seccomp_fprog_t mfp;
+
+ if (sizeof(*pfp) == sizeof(mfp))
+ return !umove_or_printaddr(tcp, addr, pfp);
+
+ if (umove_or_printaddr(tcp, addr, &mfp))
+ return false;
+
+ pfp->len = mfp.len;
+ pfp->filter = mfp.filter;
+ return true;
+}