Reduce PID finding retries and simply proc interface on linux

This commit is contained in:
Daniel
2023-12-18 17:03:48 +01:00
parent 6822b7a8a8
commit d67b1e8a64
5 changed files with 24 additions and 72 deletions

View File

@@ -28,6 +28,11 @@ var (
ErrPIDNotFound = errors.New("could not find pid for socket inode")
)
const (
lookupTries = 5
fastLookupTries = 2
)
// Lookup looks for the given connection in the system state tables and returns the PID of the associated process and whether the connection is inbound.
func Lookup(pktInfo *packet.Info, fast bool) (pid int, inbound bool, err error) {
// auto-detect version