Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/sys: new syscall.PtraceInterrupt for linux #34755

Closed
pjbgf opened this issue Oct 8, 2019 · 1 comment
Closed

x/sys: new syscall.PtraceInterrupt for linux #34755

pjbgf opened this issue Oct 8, 2019 · 1 comment

Comments

@pjbgf
Copy link

pjbgf commented Oct 8, 2019

A new func inside syscall to expose the use of PTRACE_INTERRUPT.

PTRACE_INTERRUPT (since Linux 3.4)
Stop a tracee. If the tracee is running or sleeping in kernel
space and PTRACE_SYSCALL is in effect, the system call is
interrupted and syscall-exit-stop is reported. (The inter‐
rupted system call is restarted when the tracee is restarted.)
If the tracee was already stopped by a signal and PTRACE_LIS‐
TEN was sent to it, the tracee stops with PTRACE_EVENT_STOP
and WSTOPSIG(status) returns the stop signal. If any other
ptrace-stop is generated at the same time (for example, if a
signal is sent to the tracee), this ptrace-stop happens. If
none of the above applies (for example, if the tracee is run‐
ning in user space), it stops with PTRACE_EVENT_STOP with
WSTOPSIG(status) == SIGTRAP. PTRACE_INTERRUPT only works on
tracees attached by PTRACE_SEIZE.
source: ptrace in Linux

The flag already exists in the codebase:

PTRACE_INTERRUPT = 0x4207

@gopherbot
Copy link

Change https://golang.org/cl/199504 mentions this issue: unix: add new func PtraceInterrupt on Linux

@tklauser tklauser changed the title proposal: x/sys: new syscall.PtraceInterrupt for linux x/sys: new syscall.PtraceInterrupt for linux Oct 8, 2019
@tklauser tklauser removed the Proposal label Oct 8, 2019
@golang golang locked and limited conversation to collaborators Oct 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants