ptrace_user.c 393 B

1234567891011121314151617181920212223
  1. /*
  2. * Copyright 2003 PathScale, Inc.
  3. *
  4. * Licensed under the GPL
  5. */
  6. #include <errno.h>
  7. #include "ptrace_user.h"
  8. int ptrace_getregs(long pid, unsigned long *regs_out)
  9. {
  10. if (ptrace(PTRACE_GETREGS, pid, 0, regs_out) < 0)
  11. return -errno;
  12. return(0);
  13. }
  14. int ptrace_setregs(long pid, unsigned long *regs_out)
  15. {
  16. if (ptrace(PTRACE_SETREGS, pid, 0, regs_out) < 0)
  17. return -errno;
  18. return(0);
  19. }