diff --git a/process.go b/process.go index 2b5e8ed..7f5bd19 100644 --- a/process.go +++ b/process.go @@ -19,6 +19,9 @@ type Process interface { // Executable name running this process. This is not a path to the // executable. Executable() string + + // State for this process. Returns zero on Darwin and Windows. + State() rune } // Processes returns all processes. diff --git a/process_darwin.go b/process_darwin.go index 5ee87fb..a1e536f 100644 --- a/process_darwin.go +++ b/process_darwin.go @@ -27,6 +27,10 @@ func (p *DarwinProcess) Executable() string { return p.binary } +func (p *DarwinProcess) State() rune { + return 0 +} + func findProcess(pid int) (Process, error) { ps, err := processes() if err != nil { diff --git a/process_freebsd.go b/process_freebsd.go index 130acbe..210e045 100644 --- a/process_freebsd.go +++ b/process_freebsd.go @@ -121,6 +121,10 @@ func (p *UnixProcess) PPid() int { return p.ppid } +func (p *UnixProcess) State() rune { + return p.state +} + func (p *UnixProcess) Executable() string { return p.binary } diff --git a/process_unix.go b/process_unix.go index cd217a8..f7d0ba6 100644 --- a/process_unix.go +++ b/process_unix.go @@ -29,6 +29,10 @@ func (p *UnixProcess) PPid() int { return p.ppid } +func (p *UnixProcess) State() rune { + return p.state +} + func (p *UnixProcess) Executable() string { return p.binary } diff --git a/process_windows.go b/process_windows.go index f151974..4ce54ca 100644 --- a/process_windows.go +++ b/process_windows.go @@ -57,6 +57,10 @@ func (p *WindowsProcess) Executable() string { return p.exe } +func (p *WindowsProcess) State() rune { + return 0 +} + func newWindowsProcess(e *PROCESSENTRY32) *WindowsProcess { // Find when the string ends for decoding end := 0