Initial FreeBSD PID support

This commit is contained in:
2025-04-04 01:36:14 -04:00
parent 1210f10798
commit cfcdc4bfaa
6 changed files with 8 additions and 10 deletions
+2 -2
View File
@@ -9,7 +9,7 @@ import (
"net"
"strconv"
"golang.org/x/sys/unix"
"github.com/rwinkhart/sys/unix"
)
func getUnix(c *net.UnixConn) (*Creds, error) {
@@ -35,7 +35,7 @@ func getUnix(c *net.UnixConn) (*Creds, error) {
return nil, err
}
return &Creds{
pid: 0, // FreeBSD 13 adds a cr_pid field, can be used here.
pid: int(cred.Pid),
uid: strconv.FormatUint(uint64(cred.Uid), 10),
}, nil
}