File: pidfile_darwin.go

package info (click to toggle)
webhook 2.8.0-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 11,064 kB
  • sloc: asm: 1,650; sh: 620; xml: 88; makefile: 50; ansic: 24
file content (14 lines) | stat: -rw-r--r-- 248 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// +build darwin

package pidfile

import (
	"golang.org/x/sys/unix"
)

func processExists(pid int) bool {
	// OS X does not have a proc filesystem.
	// Use kill -0 pid to judge if the process exists.
	err := unix.Kill(pid, 0)
	return err == nil
}