blob: c57a496d3f5b13d668946067e62b7f0ae0a7663a [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * Copyright 2003 PathScale, Inc.
3 *
4 * Licensed under the GPL
5 */
6
Linus Torvalds1da177e2005-04-16 15:20:36 -07007#include <errno.h>
8#include "ptrace_user.h"
Linus Torvalds1da177e2005-04-16 15:20:36 -07009
10int ptrace_getregs(long pid, unsigned long *regs_out)
11{
Jeff Dike95906b22008-02-04 22:31:20 -080012 if (ptrace(PTRACE_GETREGS, pid, 0, regs_out) < 0)
Jeff Dikee2216fe2006-02-07 12:58:43 -080013 return -errno;
Jeff Dike95906b22008-02-04 22:31:20 -080014 return(0);
Jeff Dikee2216fe2006-02-07 12:58:43 -080015}
16
Jeff Dike95906b22008-02-04 22:31:20 -080017int ptrace_setregs(long pid, unsigned long *regs_out)
Linus Torvalds1da177e2005-04-16 15:20:36 -070018{
Jeff Dike95906b22008-02-04 22:31:20 -080019 if (ptrace(PTRACE_SETREGS, pid, 0, regs_out) < 0)
20 return -errno;
21 return(0);
Linus Torvalds1da177e2005-04-16 15:20:36 -070022}