1 /*
2 * Copyright (c) 2016 Dmitry V. Levin <ldv@strace.io>
3 * Copyright (c) 2016-2021 The strace developers.
4 * All rights reserved.
5 *
6 * SPDX-License-Identifier: LGPL-2.1-or-later
7 */
8
9 #include "defs.h"
10 #include "ptrace.h"
11 #include "ptrace_pokeuser.c"
12
13 int
14 upoke(struct tcb *tcp, unsigned long off, kernel_ulong_t val)
15 {
16 if (ptrace_pokeuser(tcp->pid, off, val) < 0) {
17 if (errno != ESRCH)
18 perror_func_msg("PTRACE_POKEUSER pid:%d @%#lx)",
19 tcp->pid, off);
20 return -1;
21 }
22 return 0;
23 }