#define _GNU_SOURCE
#include <stddef.h>
#include <sys/ptrace.h>
+#include <sys/types.h>
#include <sys/user.h>
#include <sys/wait.h>
-#include <sys/types.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
# define EF_REG2 8
# endif
#define reg_syscall_nr (EF_REG2 / 4)
+#elif defined(__arm__)
+#define reg_syscall_nr _offsetof(struct user, regs.uregs[7])
#else
#error tracing is not supported on this architecture
#endif
uloop_done();
if (!json)
- asprintf(&json, "/tmp/%s.%u.json", basename(*argv), child);
+ if (asprintf(&json, "/tmp/%s.%u.json", basename(*argv), child) < 0)
+ ERROR("failed to allocate output path: %s\n", strerror(errno));
print_syscalls(policy, json);