gunk-dev/the-valley

procattr_linux.go

source9ee95920e399main's published tip history
558 bytes
1package main
2
3import "syscall"
4
5// dieWithParent makes a child process be killed when this process dies,
6// however it dies: a signal, SIGPIPE from a reader that went away, or
7// SIGKILL. It is attest's own (attest/procattr_linux.go). Linux sends the
8// signal when the thread that started the child ends. Go ends a thread
9// only when a goroutine locked to it ends still locked, and nothing here
10// locks one, so the thread lasts as long as the process.
11func dieWithParent() *syscall.SysProcAttr {
12 return &syscall.SysProcAttr{Pdeathsig: syscall.SIGKILL}
13}