1// +build darwin freebsd openbsd
2
3package process
4
5import (
6	"bytes"
7	"context"
8	"encoding/binary"
9
10	"github.com/shirou/gopsutil/cpu"
11	"github.com/shirou/gopsutil/internal/common"
12	"github.com/shirou/gopsutil/net"
13)
14
15type MemoryInfoExStat struct{}
16
17type MemoryMapsStat struct{}
18
19func (p *Process) TgidWithContext(ctx context.Context) (int32, error) {
20	return 0, common.ErrNotImplementedError
21}
22
23func (p *Process) CwdWithContext(ctx context.Context) (string, error) {
24	return "", common.ErrNotImplementedError
25}
26
27func (p *Process) IOniceWithContext(ctx context.Context) (int32, error) {
28	return 0, common.ErrNotImplementedError
29}
30
31func (p *Process) RlimitWithContext(ctx context.Context) ([]RlimitStat, error) {
32	return nil, common.ErrNotImplementedError
33}
34
35func (p *Process) RlimitUsageWithContext(ctx context.Context, gatherUsed bool) ([]RlimitStat, error) {
36	return nil, common.ErrNotImplementedError
37}
38
39func (p *Process) NumCtxSwitchesWithContext(ctx context.Context) (*NumCtxSwitchesStat, error) {
40	return nil, common.ErrNotImplementedError
41}
42
43func (p *Process) NumFDsWithContext(ctx context.Context) (int32, error) {
44	return 0, common.ErrNotImplementedError
45}
46
47func (p *Process) CPUAffinityWithContext(ctx context.Context) ([]int32, error) {
48	return nil, common.ErrNotImplementedError
49}
50
51func (p *Process) MemoryInfoExWithContext(ctx context.Context) (*MemoryInfoExStat, error) {
52	return nil, common.ErrNotImplementedError
53}
54
55func (p *Process) PageFaultsWithContext(ctx context.Context) (*PageFaultsStat, error) {
56	return nil, common.ErrNotImplementedError
57}
58
59func (p *Process) OpenFilesWithContext(ctx context.Context) ([]OpenFilesStat, error) {
60	return nil, common.ErrNotImplementedError
61}
62
63func (p *Process) NetIOCountersWithContext(ctx context.Context, pernic bool) ([]net.IOCountersStat, error) {
64	return nil, common.ErrNotImplementedError
65}
66
67func (p *Process) MemoryMapsWithContext(ctx context.Context, grouped bool) (*[]MemoryMapsStat, error) {
68	return nil, common.ErrNotImplementedError
69}
70
71func (p *Process) ThreadsWithContext(ctx context.Context) (map[int32]*cpu.TimesStat, error) {
72	return nil, common.ErrNotImplementedError
73}
74
75func (p *Process) EnvironWithContext(ctx context.Context) ([]string, error) {
76	return nil, common.ErrNotImplementedError
77}
78
79func parseKinfoProc(buf []byte) (KinfoProc, error) {
80	var k KinfoProc
81	br := bytes.NewReader(buf)
82	err := common.Read(br, binary.LittleEndian, &k)
83	return k, err
84}
85