github.com/isyscore/isc-gobase@v1.5.3-0.20231218061332-cbc7451899e9/system/process/process_bsd.go (about)

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