https://github.com/torvalds/linux
Raw File
Tip revision: 5b394b2ddf0347bef56e50c69a58773c94343ff3 authored by Linus Torvalds on 26 August 2018, 21:11:59 UTC
Linux 4.19-rc1
Tip revision: 5b394b2
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