Skip to content

Commit

Permalink
Merge pull request #1428 from dhurley/add-support-for-process-exe-for…
Browse files Browse the repository at this point in the history
…-freebsd

FreeBSD process exe support
  • Loading branch information
shirou authored Mar 10, 2023
2 parents 50d889c + cf25de7 commit c7c548d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion process/process_freebsd.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit c7c548d

Please sign in to comment.