1
0
mirror of https://github.com/rancher/os.git synced 2025-06-22 13:07:04 +00:00
os/init/one.go
2016-02-04 09:06:15 -07:00

25 lines
313 B
Go

// +build linux
package init
import (
"os"
"os/signal"
"syscall"
)
func pidOne() error {
c := make(chan os.Signal, 2048)
signal.Notify(c, syscall.SIGCHLD)
for range c {
for {
if pid, err := syscall.Wait4(-1, nil, syscall.WNOHANG, nil); err != nil || pid <= 0 {
break
}
}
}
return nil
}