https://github.com/torvalds/linux
Raw File
Tip revision: 4c2e07c6a29e0129e975727b9f57eede813eea85 authored by Linus Torvalds on 27 June 2016, 00:52:03 UTC
Linux 4.7-rc5
Tip revision: 4c2e07c
ptrace_user.c
/*
 * Copyright (C) 2002 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
 * Licensed under the GPL
 */

#include <errno.h>
#include <ptrace_user.h>

int ptrace_getregs(long pid, unsigned long *regs_out)
{
	if (ptrace(PTRACE_GETREGS, pid, 0, regs_out) < 0)
		return -errno;
	return 0;
}

int ptrace_setregs(long pid, unsigned long *regs)
{
	if (ptrace(PTRACE_SETREGS, pid, 0, regs) < 0)
		return -errno;
	return 0;
}
back to top