xref: /linux/tools/include/nolibc/sys/ptrace.h (revision 861ea34546dcde8600878d5e7f746795f22fc818)
1 /* SPDX-License-Identifier: LGPL-2.1 OR MIT */
2 /*
3  * ptrace for NOLIBC
4  * Copyright (C) 2017-2021 Willy Tarreau <w@1wt.eu>
5  * Copyright (C) 2025 Intel Corporation
6  */
7 
8 /* make sure to include all global symbols */
9 #include "../nolibc.h"
10 
11 #ifndef _NOLIBC_SYS_PTRACE_H
12 #define _NOLIBC_SYS_PTRACE_H
13 
14 #include "../sys.h"
15 
16 #include <linux/ptrace.h>
17 
18 /*
19  * long ptrace(int op, pid_t pid, void *addr, void *data);
20  */
21 static __attribute__((unused))
22 long sys_ptrace(int op, pid_t pid, void *addr, void *data)
23 {
24 	return my_syscall4(__NR_ptrace, op, pid, addr, data);
25 }
26 
27 static __attribute__((unused))
28 ssize_t ptrace(int op, pid_t pid, void *addr, void *data)
29 {
30 	return __sysret(sys_ptrace(op, pid, addr, data));
31 }
32 
33 #endif /* _NOLIBC_SYS_PTRACE_H */
34