Skip to content

Commit b115207

Browse files
syscall: document LockOSThread with GNU/Linux SysProcAttr.Ptrace
Fixes #28315 Change-Id: Ie02c72d02ad2f66c9cdbbba579a304641f327672 Reviewed-on: https://go-review.googlesource.com/c/155138 Reviewed-by: Brad Fitzpatrick <[email protected]>
1 parent c0914d5 commit b115207

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/syscall/exec_linux.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,12 @@ type SysProcIDMap struct {
2020
}
2121

2222
type SysProcAttr struct {
23-
Chroot string // Chroot.
24-
Credential *Credential // Credential.
25-
Ptrace bool // Enable tracing.
23+
Chroot string // Chroot.
24+
Credential *Credential // Credential.
25+
// Ptrace tells the child to call ptrace(PTRACE_TRACEME).
26+
// Call runtime.LockOSThread before starting a process with this set,
27+
// and don't call UnlockOSThread until done with PtraceSyscall calls.
28+
Ptrace bool
2629
Setsid bool // Create session.
2730
Setpgid bool // Set process group ID to Pgid, or, if Pgid == 0, to new pid.
2831
Setctty bool // Set controlling terminal to fd Ctty (only meaningful if Setsid is set)

0 commit comments

Comments
 (0)