Mirror of strace – the linux syscall tracer
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

upoke.c 496B

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