From: Vojtěch Boček Date: Wed, 15 Jun 2022 09:36:27 +0000 (+0000) Subject: syscall: clarify Pdeathsig documentation on Linux X-Git-Tag: go1.19rc1~115 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=0e3d0c9581d1d31a94f5c70a528ff0bdba5c523d;p=gostls13.git 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: c8722b25d1fb8b0b3696257ec7e955eb421f15a6 GitHub-Pull-Request: golang/go#53365 Reviewed-on: https://go-review.googlesource.com/c/go/+/412114 Reviewed-by: Ian Lance Taylor Auto-Submit: Ian Lance Taylor TryBot-Result: Gopher Robot Run-TryBot: Ian Lance Taylor Reviewed-by: Cherry Mui --- diff --git a/src/syscall/exec_linux.go b/src/syscall/exec_linux.go index 6d4b6939ad..ede8247da9 100644 --- a/src/syscall/exec_linux.go +++ b/src/syscall/exec_linux.go @@ -45,7 +45,11 @@ type SysProcAttr struct { // number in the parent process. Foreground bool Pgid int // Child's process group ID if Setpgid. - Pdeathsig Signal // Signal that the process will get when its parent dies (Linux and FreeBSD only) + // Pdeathsig, if non-zero, is a signal that the kernel will send to + // the child process when the creating thread dies. Note that the signal + // is sent on thread termination, which may happen before process termination. + // There are more details at https://go.dev/issue/27505. + Pdeathsig Signal Cloneflags uintptr // Flags for clone calls (Linux only) Unshareflags uintptr // Flags for unshare calls (Linux only) UidMappings []SysProcIDMap // User ID mappings for user namespaces.