]> granicus.if.org Git - strace/blob - linux/arm/set_scno.c
aarch64, arm, sparc: add comments on fault injection support in kernel
[strace] / linux / arm / set_scno.c
1 #ifndef PTRACE_SET_SYSCALL
2 # define PTRACE_SET_SYSCALL 23
3 #endif
4 /*
5  * PTRACE_SET_SYSCALL is supported by linux kernel
6  * starting with commit v2.6.16-rc1~107^2
7  */
8
9 static int
10 arch_set_scno(struct tcb *tcp, long scno)
11 {
12         unsigned int n = (uint16_t) scno;
13         int rc = ptrace(PTRACE_SET_SYSCALL, tcp->pid, NULL, (unsigned long) n);
14         if (rc && errno != ESRCH)
15                 perror_msg("arch_set_scno: PTRACE_SET_SYSCALL pid:%d scno:%#x",
16                            tcp->pid, n);
17         return rc;
18 }