ptrace_user.c 419 B

123456789101112131415161718192021
  1. /*
  2. * Copyright (C) 2002 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
  3. * Licensed under the GPL
  4. */
  5. #include <errno.h>
  6. #include <ptrace_user.h>
  7. int ptrace_getregs(long pid, unsigned long *regs_out)
  8. {
  9. if (ptrace(PTRACE_GETREGS, pid, 0, regs_out) < 0)
  10. return -errno;
  11. return 0;
  12. }
  13. int ptrace_setregs(long pid, unsigned long *regs)
  14. {
  15. if (ptrace(PTRACE_SETREGS, pid, 0, regs) < 0)
  16. return -errno;
  17. return 0;
  18. }