1
0
mirror of https://github.com/shirou/gopsutil.git synced 2025-04-26 13:48:59 +08:00

Merge pull request #1551 from blinklabs-io/feat/use-lsof-freebsd-connections

feat: use lsof for net_connections on FreeBSD
This commit is contained in:
shirou 2023-11-12 10:37:03 +09:00 committed by GitHub
commit fad5e68647
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -190,7 +190,7 @@ Some code is ported from Ohai. Many thanks.
|users |x |x |x |x |x | | |
|pids |x |x |x |x |x | | |
|pid\_exists |x |x |x |x |x | | |
|net\_connections |x | |x |x | | | |
|net\_connections |x |x |x |x | | | |
|net\_protocols |x | | | | | | |
|net\_if\_addrs | | | | | | | |
|net\_if\_stats | | | | | | | |

View File

@ -286,11 +286,11 @@ func (p *Process) ChildrenWithContext(ctx context.Context) ([]*Process, error) {
}
func (p *Process) ConnectionsWithContext(ctx context.Context) ([]net.ConnectionStat, error) {
return nil, common.ErrNotImplementedError
return net.ConnectionsPidWithContext(ctx, "all", p.Pid)
}
func (p *Process) ConnectionsMaxWithContext(ctx context.Context, max int) ([]net.ConnectionStat, error) {
return nil, common.ErrNotImplementedError
return net.ConnectionsPidMaxWithContext(ctx, "all", p.Pid, max)
}
func ProcessesWithContext(ctx context.Context) ([]*Process, error) {