Add support for getting process exe in FreeBSD

pull/1428/head
Donal Hurley 2 years ago
parent dda567eee6
commit cf25de7460

@ -69,7 +69,13 @@ func (p *Process) CwdWithContext(ctx context.Context) (string, error) {
}
func (p *Process) ExeWithContext(ctx context.Context) (string, error) {
return "", common.ErrNotImplementedError
mib := []int32{CTLKern, KernProc, KernProcPathname, p.Pid}
buf, _, err := common.CallSyscall(mib)
if err != nil {
return "", err
}
return strings.Trim(string(buf), "\x00"), nil
}
func (p *Process) CmdlineWithContext(ctx context.Context) (string, error) {

Loading…
Cancel
Save