https://github.com/torvalds/linux
Raw File
Tip revision: 7e364e56293bb98cae1b55fd835f5991c4e96e7d authored by Linus Torvalds on 02 April 2023, 21:29:29 UTC
Linux 6.3-rc5
Tip revision: 7e364e5
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