linux/include/uapi/linux/ptrace.h

/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef _UAPI_LINUX_PTRACE_H
#define _UAPI_LINUX_PTRACE_H
/* ptrace.h */
/* structs and defines to help the user use the ptrace system call. */

/* has the defines to get at the registers. */

#include <linux/types.h>

#define PTRACE_TRACEME
#define PTRACE_PEEKTEXT
#define PTRACE_PEEKDATA
#define PTRACE_PEEKUSR
#define PTRACE_POKETEXT
#define PTRACE_POKEDATA
#define PTRACE_POKEUSR
#define PTRACE_CONT
#define PTRACE_KILL
#define PTRACE_SINGLESTEP

#define PTRACE_ATTACH
#define PTRACE_DETACH

#define PTRACE_SYSCALL

/* 0x4200-0x4300 are reserved for architecture-independent additions.  */
#define PTRACE_SETOPTIONS
#define PTRACE_GETEVENTMSG
#define PTRACE_GETSIGINFO
#define PTRACE_SETSIGINFO

/*
 * Generic ptrace interface that exports the architecture specific regsets
 * using the corresponding NT_* types (which are also used in the core dump).
 * Please note that the NT_PRSTATUS note type in a core dump contains a full
 * 'struct elf_prstatus'. But the user_regset for NT_PRSTATUS contains just the
 * elf_gregset_t that is the pr_reg field of 'struct elf_prstatus'. For all the
 * other user_regset flavors, the user_regset layout and the ELF core dump note
 * payload are exactly the same layout.
 *
 * This interface usage is as follows:
 *	struct iovec iov = { buf, len};
 *
 *	ret = ptrace(PTRACE_GETREGSET/PTRACE_SETREGSET, pid, NT_XXX_TYPE, &iov);
 *
 * On the successful completion, iov.len will be updated by the kernel,
 * specifying how much the kernel has written/read to/from the user's iov.buf.
 */
#define PTRACE_GETREGSET
#define PTRACE_SETREGSET

#define PTRACE_SEIZE
#define PTRACE_INTERRUPT
#define PTRACE_LISTEN

#define PTRACE_PEEKSIGINFO

struct ptrace_peeksiginfo_args {};

#define PTRACE_GETSIGMASK
#define PTRACE_SETSIGMASK

#define PTRACE_SECCOMP_GET_FILTER
#define PTRACE_SECCOMP_GET_METADATA

struct seccomp_metadata {};

#define PTRACE_GET_SYSCALL_INFO
#define PTRACE_SYSCALL_INFO_NONE
#define PTRACE_SYSCALL_INFO_ENTRY
#define PTRACE_SYSCALL_INFO_EXIT
#define PTRACE_SYSCALL_INFO_SECCOMP

struct ptrace_syscall_info {};

#define PTRACE_GET_RSEQ_CONFIGURATION

struct ptrace_rseq_configuration {};

#define PTRACE_SET_SYSCALL_USER_DISPATCH_CONFIG
#define PTRACE_GET_SYSCALL_USER_DISPATCH_CONFIG

/*
 * struct ptrace_sud_config - Per-task configuration for Syscall User Dispatch
 * @mode:	One of PR_SYS_DISPATCH_ON or PR_SYS_DISPATCH_OFF
 * @selector:	Tracees user virtual address of SUD selector
 * @offset:	SUD exclusion area (virtual address)
 * @len:	Length of SUD exclusion area
 *
 * Used to get/set the syscall user dispatch configuration for a tracee.
 * Selector is optional (may be NULL), and if invalid will produce
 * a SIGSEGV in the tracee upon first access.
 *
 * If mode is PR_SYS_DISPATCH_ON, syscall dispatch will be enabled. If
 * PR_SYS_DISPATCH_OFF, syscall dispatch will be disabled and all other
 * parameters must be 0.  The value in *selector (if not null), also determines
 * whether syscall dispatch will occur.
 *
 * The Syscall User Dispatch Exclusion area described by offset/len is the
 * virtual address space from which syscalls will not produce a user
 * dispatch.
 */
struct ptrace_sud_config {};

/*
 * These values are stored in task->ptrace_message
 * by ptrace_stop to describe the current syscall-stop.
 */
#define PTRACE_EVENTMSG_SYSCALL_ENTRY
#define PTRACE_EVENTMSG_SYSCALL_EXIT

/* Read signals from a shared (process wide) queue */
#define PTRACE_PEEKSIGINFO_SHARED

/* Wait extended result codes for the above trace options.  */
#define PTRACE_EVENT_FORK
#define PTRACE_EVENT_VFORK
#define PTRACE_EVENT_CLONE
#define PTRACE_EVENT_EXEC
#define PTRACE_EVENT_VFORK_DONE
#define PTRACE_EVENT_EXIT
#define PTRACE_EVENT_SECCOMP
/* Extended result codes which enabled by means other than options.  */
#define PTRACE_EVENT_STOP

/* Options set using PTRACE_SETOPTIONS or using PTRACE_SEIZE @data param */
#define PTRACE_O_TRACESYSGOOD
#define PTRACE_O_TRACEFORK
#define PTRACE_O_TRACEVFORK
#define PTRACE_O_TRACECLONE
#define PTRACE_O_TRACEEXEC
#define PTRACE_O_TRACEVFORKDONE
#define PTRACE_O_TRACEEXIT
#define PTRACE_O_TRACESECCOMP

/* eventless options */
#define PTRACE_O_EXITKILL
#define PTRACE_O_SUSPEND_SECCOMP

#define PTRACE_O_MASK

#include <asm/ptrace.h>


#endif /* _UAPI_LINUX_PTRACE_H */