Add process.Release for unix

Signed-off-by: leongross <leon.gross@9elements.com>
This commit is contained in:
leongross
2024-05-07 17:06:19 +02:00
committed by Ron Evans
parent 3a8ef33c72
commit 3023ba584b
3 changed files with 31 additions and 15 deletions
+10
View File
@@ -62,6 +62,9 @@ func StartProcess(name string, argv []string, attr *ProcAttr) (*Process, error)
}
func (p *Process) Wait() (*ProcessState, error) {
if p.Pid == -1 {
return nil, syscall.EINVAL
}
return nil, ErrNotImplemented
}
@@ -78,6 +81,13 @@ func Ignore(sig ...Signal) {
return
}
// Release releases any resources associated with the Process p,
// rendering it unusable in the future.
// Release only needs to be called if Wait is not.
func (p *Process) Release() error {
return p.release()
}
// Keep compatibility with golang and always succeed and return new proc with pid on Linux.
func FindProcess(pid int) (*Process, error) {
return findProcess(pid)