From 295e74008f89354479c42acddab82b930bdeb9a5 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Sun, 3 May 2020 16:58:26 +0200 Subject: [PATCH] sys: remove custom setChildSubreaper const Signed-off-by: Sebastiaan van Stijn --- sys/reaper_linux.go | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/sys/reaper_linux.go b/sys/reaper_linux.go index ecb0bd031..e2f493e16 100644 --- a/sys/reaper_linux.go +++ b/sys/reaper_linux.go @@ -22,22 +22,9 @@ import ( "golang.org/x/sys/unix" ) -// If arg2 is nonzero, set the "child subreaper" attribute of the -// calling process; if arg2 is zero, unset the attribute. When a -// process is marked as a child subreaper, all of the children -// that it creates, and their descendants, will be marked as -// having a subreaper. In effect, a subreaper fulfills the role -// of init(1) for its descendant processes. Upon termination of -// a process that is orphaned (i.e., its immediate parent has -// already terminated) and marked as having a subreaper, the -// nearest still living ancestor subreaper will receive a SIGCHLD -// signal and be able to wait(2) on the process to discover its -// termination status. -const setChildSubreaper = 36 - // SetSubreaper sets the value i as the subreaper setting for the calling process func SetSubreaper(i int) error { - return unix.Prctl(setChildSubreaper, uintptr(i), 0, 0, 0) + return unix.Prctl(unix.PR_SET_CHILD_SUBREAPER, uintptr(i), 0, 0, 0) } // GetSubreaper returns the subreaper setting for the calling process