Skip to content

Commit 0e3d0c9

Browse files
Tasssadargopherbot
authored andcommitted
syscall: clarify Pdeathsig documentation on Linux
This is a rather large footgun, so let's mention that it sends the signal on thread termination and not process termination in the documentation. Updates #27505 Change-Id: I489cf7136e34a1a7896067ae24187b0d523d987e GitHub-Last-Rev: c8722b2 GitHub-Pull-Request: #53365 Reviewed-on: https://go-review.googlesource.com/c/go/+/412114 Reviewed-by: Ian Lance Taylor <[email protected]> Auto-Submit: Ian Lance Taylor <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Run-TryBot: Ian Lance Taylor <[email protected]> Reviewed-by: Cherry Mui <[email protected]>
1 parent 74bf90c commit 0e3d0c9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/syscall/exec_linux.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,11 @@ type SysProcAttr struct {
4545
// number in the parent process.
4646
Foreground bool
4747
Pgid int // Child's process group ID if Setpgid.
48-
Pdeathsig Signal // Signal that the process will get when its parent dies (Linux and FreeBSD only)
48+
// Pdeathsig, if non-zero, is a signal that the kernel will send to
49+
// the child process when the creating thread dies. Note that the signal
50+
// is sent on thread termination, which may happen before process termination.
51+
// There are more details at https://go.dev/issue/27505.
52+
Pdeathsig Signal
4953
Cloneflags uintptr // Flags for clone calls (Linux only)
5054
Unshareflags uintptr // Flags for unshare calls (Linux only)
5155
UidMappings []SysProcIDMap // User ID mappings for user namespaces.

0 commit comments

Comments
 (0)