diff options
Diffstat (limited to 'src/exec_ptrace.h')
-rw-r--r-- | src/exec_ptrace.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/exec_ptrace.h b/src/exec_ptrace.h index 4340a48ea..680194db3 100644 --- a/src/exec_ptrace.h +++ b/src/exec_ptrace.h @@ -50,6 +50,10 @@ #define WORDALIGN(_a, _r) \ (((_a) + ((long)(_r).wordsize - 1L)) & ~((long)(_r).wordsize - 1L)) +/* Align pointer to a native word boundary. */ +#define LONGALIGN(_p) \ + (((unsigned long)(_p) + (sizeof(long) - 1)) & ~(sizeof(long) - 1)) + /* * See syscall(2) for a list of registers used in system calls. * For example code, see tools/testing/selftests/seccomp/seccomp_bpf.c @@ -88,9 +92,9 @@ # define reg_arg4(x) (x).regs[3] /* x3 */ # define reg_set_syscall(_r, _nr) do { \ struct iovec _iov; \ - long syscallno = (_nr); \ - _iov.iov_base = &syscallno; \ - _iov.iov_len = sizeof(syscallno); \ + long _syscallno = (_nr); \ + _iov.iov_base = &_syscallno; \ + _iov.iov_len = sizeof(_syscallno); \ ptrace(PTRACE_SETREGSET, pid, NT_ARM_SYSTEM_CALL, &_iov); \ } while (0) #elif defined(__arm__) |