]> granicus.if.org Git - strace/blob - linux/aarch64/set_scno.c
aarch64, arm, sparc: add comments on fault injection support in kernel
[strace] / linux / aarch64 / set_scno.c
1 #ifndef NT_ARM_SYSTEM_CALL
2 # define NT_ARM_SYSTEM_CALL 0x404
3 #endif
4 /*
5  * NT_ARM_SYSTEM_CALL regset is supported by linux kernel
6  * starting with commit v3.19-rc1~59^2~16.
7  */
8
9 static int
10 arch_set_scno(struct tcb *tcp, long scno)
11 {
12         unsigned int n = (uint16_t) scno;
13         const struct iovec io = {
14                 .iov_base = &n,
15                 .iov_len = sizeof(n)
16         };
17         int rc = ptrace(PTRACE_SETREGSET, tcp->pid, NT_ARM_SYSTEM_CALL, &io);
18         if (rc && errno != ESRCH)
19                 perror_msg("arch_set_scno: NT_ARM_SYSTEM_CALL pid:%d scno:%#x",
20                            tcp->pid, n);
21         return rc;
22 }