2005-04-16 15:20:36 -07:00
|
|
|
/*
|
|
|
|
* Copyright 2003 PathScale, Inc.
|
|
|
|
*
|
|
|
|
* Licensed under the GPL
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <errno.h>
|
|
|
|
#include "ptrace_user.h"
|
|
|
|
|
|
|
|
int ptrace_getregs(long pid, unsigned long *regs_out)
|
|
|
|
{
|
2008-02-04 23:31:20 -07:00
|
|
|
if (ptrace(PTRACE_GETREGS, pid, 0, regs_out) < 0)
|
|
|
|
return -errno;
|
2005-04-16 15:20:36 -07:00
|
|
|
return(0);
|
|
|
|
}
|
|
|
|
|
2008-02-04 23:31:20 -07:00
|
|
|
int ptrace_setregs(long pid, unsigned long *regs_out)
|
2006-02-07 13:58:43 -07:00
|
|
|
{
|
2008-02-04 23:31:20 -07:00
|
|
|
if (ptrace(PTRACE_SETREGS, pid, 0, regs_out) < 0)
|
2006-02-07 13:58:43 -07:00
|
|
|
return -errno;
|
2008-02-04 23:31:20 -07:00
|
|
|
return(0);
|
2005-04-16 15:20:36 -07:00
|
|
|
}
|