From 2b46cffe574432bd902e9e20fb00846cc2d2817d Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Sun, 3 Sep 2023 13:49:10 -0700 Subject: [PATCH] syscall: improve linux SysProcAttr documentation The SysProcAttr is OS-specific anyway, so it makes little sense to say that some fields are Linux-specific (they all are anyway). While at it, make sure to use complete sentences (add missing periods). Change-Id: Ic0afe3920c2561fd9a657f4edab21939a8f56d57 Reviewed-on: https://go-review.googlesource.com/c/go/+/525395 Reviewed-by: Ian Lance Taylor Auto-Submit: Ian Lance Taylor Reviewed-by: Tobias Klauser Reviewed-by: Matthew Dempsky LUCI-TryBot-Result: Go LUCI --- src/syscall/exec_linux.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/syscall/exec_linux.go b/src/syscall/exec_linux.go index 791b263b2a..fb9a5dc907 100644 --- a/src/syscall/exec_linux.go +++ b/src/syscall/exec_linux.go @@ -75,8 +75,8 @@ type SysProcAttr struct { // in the child process: an index into ProcAttr.Files. // This is only meaningful if Setsid is true. Setctty bool - Noctty bool // Detach fd 0 from controlling terminal - Ctty int // Controlling TTY fd + Noctty bool // Detach fd 0 from controlling terminal. + Ctty int // Controlling TTY fd. // Foreground places the child process group in the foreground. // This implies Setpgid. The Ctty field must be set to // the descriptor of the controlling TTY. @@ -89,8 +89,8 @@ type SysProcAttr struct { // 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) + Cloneflags uintptr // Flags for clone calls. + Unshareflags uintptr // Flags for unshare calls. UidMappings []SysProcIDMap // User ID mappings for user namespaces. GidMappings []SysProcIDMap // Group ID mappings for user namespaces. // GidMappingsEnableSetgroups enabling setgroups syscall. @@ -98,7 +98,7 @@ type SysProcAttr struct { // This parameter is no-op if GidMappings == nil. Otherwise for unprivileged // users this should be set to false for mappings work. GidMappingsEnableSetgroups bool - AmbientCaps []uintptr // Ambient capabilities (Linux only) + AmbientCaps []uintptr // Ambient capabilities. UseCgroupFD bool // Whether to make use of the CgroupFD field. CgroupFD int // File descriptor of a cgroup to put the new process into. // PidFD, if not nil, is used to store the pidfd of a child, if the -- 2.48.1