mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-18 03:23:53 -04:00
tools/nolibc: add ptrace support
Add ptrace support, as it will be useful in UML. Signed-off-by: Benjamin Berg <benjamin.berg@intel.com> [Thomas: drop va_args usage and linux/uio.h inclusion] Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
This commit is contained in:
committed by
Thomas Weißschuh
parent
8f0b4cce44
commit
ec4bb8e8df
@@ -54,6 +54,7 @@ all_files := \
|
||||
sys/mman.h \
|
||||
sys/mount.h \
|
||||
sys/prctl.h \
|
||||
sys/ptrace.h \
|
||||
sys/random.h \
|
||||
sys/reboot.h \
|
||||
sys/resource.h \
|
||||
|
||||
@@ -101,6 +101,7 @@
|
||||
#include "sys/mman.h"
|
||||
#include "sys/mount.h"
|
||||
#include "sys/prctl.h"
|
||||
#include "sys/ptrace.h"
|
||||
#include "sys/random.h"
|
||||
#include "sys/reboot.h"
|
||||
#include "sys/resource.h"
|
||||
|
||||
33
tools/include/nolibc/sys/ptrace.h
Normal file
33
tools/include/nolibc/sys/ptrace.h
Normal file
@@ -0,0 +1,33 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1 OR MIT */
|
||||
/*
|
||||
* ptrace for NOLIBC
|
||||
* Copyright (C) 2017-2021 Willy Tarreau <w@1wt.eu>
|
||||
* Copyright (C) 2025 Intel Corporation
|
||||
*/
|
||||
|
||||
/* make sure to include all global symbols */
|
||||
#include "../nolibc.h"
|
||||
|
||||
#ifndef _NOLIBC_SYS_PTRACE_H
|
||||
#define _NOLIBC_SYS_PTRACE_H
|
||||
|
||||
#include "../sys.h"
|
||||
|
||||
#include <linux/ptrace.h>
|
||||
|
||||
/*
|
||||
* long ptrace(int op, pid_t pid, void *addr, void *data);
|
||||
*/
|
||||
static __attribute__((unused))
|
||||
long sys_ptrace(int op, pid_t pid, void *addr, void *data)
|
||||
{
|
||||
return my_syscall4(__NR_ptrace, op, pid, addr, data);
|
||||
}
|
||||
|
||||
static __attribute__((unused))
|
||||
ssize_t ptrace(int op, pid_t pid, void *addr, void *data)
|
||||
{
|
||||
return __sysret(sys_ptrace(op, pid, addr, data));
|
||||
}
|
||||
|
||||
#endif /* _NOLIBC_SYS_PTRACE_H */
|
||||
Reference in New Issue
Block a user