https://github.com/torvalds/linux
Raw File
Tip revision: 6ee1d745b7c9fd573fba142a2efdad76a9f1cb04 authored by Linus Torvalds on 25 January 2021, 00:47:14 UTC
Linux 5.11-rc5
Tip revision: 6ee1d74
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