2017-02-01 16:36:24 +00:00
|
|
|
// +build !darwin,!linux,!freebsd,!openbsd,!windows
|
|
|
|
|
|
|
|
package process
|
|
|
|
|
|
|
|
import (
|
2018-10-19 18:33:23 +00:00
|
|
|
"context"
|
2017-02-01 16:36:24 +00:00
|
|
|
"syscall"
|
|
|
|
|
2020-11-07 01:48:38 +00:00
|
|
|
"github.com/shirou/gopsutil/v3/cpu"
|
|
|
|
"github.com/shirou/gopsutil/v3/internal/common"
|
|
|
|
"github.com/shirou/gopsutil/v3/net"
|
2017-02-01 16:36:24 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type MemoryMapsStat struct {
|
|
|
|
Path string `json:"path"`
|
|
|
|
Rss uint64 `json:"rss"`
|
|
|
|
Size uint64 `json:"size"`
|
|
|
|
Pss uint64 `json:"pss"`
|
|
|
|
SharedClean uint64 `json:"sharedClean"`
|
|
|
|
SharedDirty uint64 `json:"sharedDirty"`
|
|
|
|
PrivateClean uint64 `json:"privateClean"`
|
|
|
|
PrivateDirty uint64 `json:"privateDirty"`
|
|
|
|
Referenced uint64 `json:"referenced"`
|
|
|
|
Anonymous uint64 `json:"anonymous"`
|
|
|
|
Swap uint64 `json:"swap"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type MemoryInfoExStat struct {
|
|
|
|
}
|
|
|
|
|
2020-07-01 12:47:56 +00:00
|
|
|
func pidsWithContext(ctx context.Context) ([]int32, error) {
|
2018-10-19 18:33:23 +00:00
|
|
|
return nil, common.ErrNotImplementedError
|
|
|
|
}
|
|
|
|
|
|
|
|
func ProcessesWithContext(ctx context.Context) ([]*Process, error) {
|
|
|
|
return nil, common.ErrNotImplementedError
|
|
|
|
}
|
|
|
|
|
2020-07-01 12:47:56 +00:00
|
|
|
func PidExistsWithContext(ctx context.Context, pid int32) (bool, error) {
|
2020-11-07 01:48:38 +00:00
|
|
|
return false, common.ErrNotImplementedError
|
2018-10-19 18:33:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (p *Process) PpidWithContext(ctx context.Context) (int32, error) {
|
2017-02-01 16:36:24 +00:00
|
|
|
return 0, common.ErrNotImplementedError
|
|
|
|
}
|
2018-10-19 18:33:23 +00:00
|
|
|
|
|
|
|
func (p *Process) NameWithContext(ctx context.Context) (string, error) {
|
2017-02-01 16:36:24 +00:00
|
|
|
return "", common.ErrNotImplementedError
|
|
|
|
}
|
2020-11-07 01:48:38 +00:00
|
|
|
|
|
|
|
func (p *Process) TgidWithContext(ctx context.Context) (int32, error) {
|
2018-10-19 18:33:23 +00:00
|
|
|
return 0, common.ErrNotImplementedError
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *Process) ExeWithContext(ctx context.Context) (string, error) {
|
2017-02-01 16:36:24 +00:00
|
|
|
return "", common.ErrNotImplementedError
|
|
|
|
}
|
2018-10-19 18:33:23 +00:00
|
|
|
|
|
|
|
func (p *Process) CmdlineWithContext(ctx context.Context) (string, error) {
|
2017-02-01 16:36:24 +00:00
|
|
|
return "", common.ErrNotImplementedError
|
|
|
|
}
|
2018-10-19 18:33:23 +00:00
|
|
|
|
|
|
|
func (p *Process) CmdlineSliceWithContext(ctx context.Context) ([]string, error) {
|
2020-11-07 01:48:38 +00:00
|
|
|
return nil, common.ErrNotImplementedError
|
2017-02-01 16:36:24 +00:00
|
|
|
}
|
2018-10-19 18:33:23 +00:00
|
|
|
|
2020-07-01 12:47:56 +00:00
|
|
|
func (p *Process) createTimeWithContext(ctx context.Context) (int64, error) {
|
2017-02-01 16:36:24 +00:00
|
|
|
return 0, common.ErrNotImplementedError
|
|
|
|
}
|
2018-10-19 18:33:23 +00:00
|
|
|
|
|
|
|
func (p *Process) CwdWithContext(ctx context.Context) (string, error) {
|
2017-02-01 16:36:24 +00:00
|
|
|
return "", common.ErrNotImplementedError
|
|
|
|
}
|
2018-10-19 18:33:23 +00:00
|
|
|
|
|
|
|
func (p *Process) ParentWithContext(ctx context.Context) (*Process, error) {
|
2017-02-01 16:36:24 +00:00
|
|
|
return nil, common.ErrNotImplementedError
|
|
|
|
}
|
2018-10-19 18:33:23 +00:00
|
|
|
|
2020-11-07 01:48:38 +00:00
|
|
|
func (p *Process) StatusWithContext(ctx context.Context) ([]string, error) {
|
|
|
|
return []string{""}, common.ErrNotImplementedError
|
2020-07-01 12:47:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (p *Process) ForegroundWithContext(ctx context.Context) (bool, error) {
|
|
|
|
return false, common.ErrNotImplementedError
|
|
|
|
}
|
2018-10-19 18:33:23 +00:00
|
|
|
|
|
|
|
func (p *Process) UidsWithContext(ctx context.Context) ([]int32, error) {
|
2020-11-07 01:48:38 +00:00
|
|
|
return nil, common.ErrNotImplementedError
|
2018-10-19 18:33:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (p *Process) GidsWithContext(ctx context.Context) ([]int32, error) {
|
2020-11-07 01:48:38 +00:00
|
|
|
return nil, common.ErrNotImplementedError
|
2017-02-01 16:36:24 +00:00
|
|
|
}
|
2020-10-07 16:57:18 +00:00
|
|
|
|
|
|
|
func (p *Process) GroupsWithContext(ctx context.Context) ([]int32, error) {
|
2020-11-07 01:48:38 +00:00
|
|
|
return nil, common.ErrNotImplementedError
|
2018-10-19 18:33:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (p *Process) TerminalWithContext(ctx context.Context) (string, error) {
|
2017-02-01 16:36:24 +00:00
|
|
|
return "", common.ErrNotImplementedError
|
|
|
|
}
|
2018-10-19 18:33:23 +00:00
|
|
|
|
|
|
|
func (p *Process) NiceWithContext(ctx context.Context) (int32, error) {
|
2017-02-01 16:36:24 +00:00
|
|
|
return 0, common.ErrNotImplementedError
|
|
|
|
}
|
2018-10-19 18:33:23 +00:00
|
|
|
|
|
|
|
func (p *Process) IOniceWithContext(ctx context.Context) (int32, error) {
|
2017-02-01 16:36:24 +00:00
|
|
|
return 0, common.ErrNotImplementedError
|
|
|
|
}
|
2018-10-19 18:33:23 +00:00
|
|
|
|
|
|
|
func (p *Process) RlimitWithContext(ctx context.Context) ([]RlimitStat, error) {
|
|
|
|
return nil, common.ErrNotImplementedError
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *Process) RlimitUsageWithContext(ctx context.Context, gatherUsed bool) ([]RlimitStat, error) {
|
2017-02-01 16:36:24 +00:00
|
|
|
return nil, common.ErrNotImplementedError
|
|
|
|
}
|
2018-10-19 18:33:23 +00:00
|
|
|
|
|
|
|
func (p *Process) IOCountersWithContext(ctx context.Context) (*IOCountersStat, error) {
|
2017-02-01 16:36:24 +00:00
|
|
|
return nil, common.ErrNotImplementedError
|
|
|
|
}
|
2018-10-19 18:33:23 +00:00
|
|
|
|
|
|
|
func (p *Process) NumCtxSwitchesWithContext(ctx context.Context) (*NumCtxSwitchesStat, error) {
|
2017-02-01 16:36:24 +00:00
|
|
|
return nil, common.ErrNotImplementedError
|
|
|
|
}
|
2018-10-19 18:33:23 +00:00
|
|
|
|
|
|
|
func (p *Process) NumFDsWithContext(ctx context.Context) (int32, error) {
|
2017-02-01 16:36:24 +00:00
|
|
|
return 0, common.ErrNotImplementedError
|
|
|
|
}
|
2018-10-19 18:33:23 +00:00
|
|
|
|
|
|
|
func (p *Process) NumThreadsWithContext(ctx context.Context) (int32, error) {
|
2017-02-01 16:36:24 +00:00
|
|
|
return 0, common.ErrNotImplementedError
|
|
|
|
}
|
2018-10-19 18:33:23 +00:00
|
|
|
|
|
|
|
func (p *Process) ThreadsWithContext(ctx context.Context) (map[int32]*cpu.TimesStat, error) {
|
2017-02-01 16:36:24 +00:00
|
|
|
return nil, common.ErrNotImplementedError
|
|
|
|
}
|
2018-10-19 18:33:23 +00:00
|
|
|
|
|
|
|
func (p *Process) TimesWithContext(ctx context.Context) (*cpu.TimesStat, error) {
|
2017-02-01 16:36:24 +00:00
|
|
|
return nil, common.ErrNotImplementedError
|
|
|
|
}
|
2018-10-19 18:33:23 +00:00
|
|
|
|
|
|
|
func (p *Process) CPUAffinityWithContext(ctx context.Context) ([]int32, error) {
|
2017-02-01 16:36:24 +00:00
|
|
|
return nil, common.ErrNotImplementedError
|
|
|
|
}
|
2018-10-19 18:33:23 +00:00
|
|
|
|
|
|
|
func (p *Process) MemoryInfoWithContext(ctx context.Context) (*MemoryInfoStat, error) {
|
2017-02-01 16:36:24 +00:00
|
|
|
return nil, common.ErrNotImplementedError
|
|
|
|
}
|
2018-10-19 18:33:23 +00:00
|
|
|
|
|
|
|
func (p *Process) MemoryInfoExWithContext(ctx context.Context) (*MemoryInfoExStat, error) {
|
2017-02-01 16:36:24 +00:00
|
|
|
return nil, common.ErrNotImplementedError
|
|
|
|
}
|
2020-11-07 01:48:38 +00:00
|
|
|
|
2020-07-01 12:47:56 +00:00
|
|
|
func (p *Process) PageFaultsWithContext(ctx context.Context) (*PageFaultsStat, error) {
|
|
|
|
return nil, common.ErrNotImplementedError
|
|
|
|
}
|
2018-10-19 18:33:23 +00:00
|
|
|
|
|
|
|
func (p *Process) ChildrenWithContext(ctx context.Context) ([]*Process, error) {
|
2017-02-01 16:36:24 +00:00
|
|
|
return nil, common.ErrNotImplementedError
|
|
|
|
}
|
2018-10-19 18:33:23 +00:00
|
|
|
|
|
|
|
func (p *Process) OpenFilesWithContext(ctx context.Context) ([]OpenFilesStat, error) {
|
2020-11-07 01:48:38 +00:00
|
|
|
return nil, common.ErrNotImplementedError
|
2018-10-19 18:33:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (p *Process) ConnectionsWithContext(ctx context.Context) ([]net.ConnectionStat, error) {
|
2020-11-07 01:48:38 +00:00
|
|
|
return nil, common.ErrNotImplementedError
|
2020-07-01 12:47:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (p *Process) ConnectionsMaxWithContext(ctx context.Context, max int) ([]net.ConnectionStat, error) {
|
2020-11-07 01:48:38 +00:00
|
|
|
return nil, common.ErrNotImplementedError
|
2018-10-19 18:33:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (p *Process) MemoryMapsWithContext(ctx context.Context, grouped bool) (*[]MemoryMapsStat, error) {
|
2017-02-01 16:36:24 +00:00
|
|
|
return nil, common.ErrNotImplementedError
|
|
|
|
}
|
2018-10-19 18:33:23 +00:00
|
|
|
|
|
|
|
func (p *Process) SendSignalWithContext(ctx context.Context, sig syscall.Signal) error {
|
2017-02-01 16:36:24 +00:00
|
|
|
return common.ErrNotImplementedError
|
|
|
|
}
|
2018-10-19 18:33:23 +00:00
|
|
|
|
|
|
|
func (p *Process) SuspendWithContext(ctx context.Context) error {
|
2017-02-01 16:36:24 +00:00
|
|
|
return common.ErrNotImplementedError
|
|
|
|
}
|
2018-10-19 18:33:23 +00:00
|
|
|
|
|
|
|
func (p *Process) ResumeWithContext(ctx context.Context) error {
|
2017-02-01 16:36:24 +00:00
|
|
|
return common.ErrNotImplementedError
|
|
|
|
}
|
2018-10-19 18:33:23 +00:00
|
|
|
|
|
|
|
func (p *Process) TerminateWithContext(ctx context.Context) error {
|
2017-02-01 16:36:24 +00:00
|
|
|
return common.ErrNotImplementedError
|
|
|
|
}
|
2018-10-19 18:33:23 +00:00
|
|
|
|
|
|
|
func (p *Process) KillWithContext(ctx context.Context) error {
|
2017-02-01 16:36:24 +00:00
|
|
|
return common.ErrNotImplementedError
|
|
|
|
}
|
2018-10-19 18:33:23 +00:00
|
|
|
|
|
|
|
func (p *Process) UsernameWithContext(ctx context.Context) (string, error) {
|
2017-02-01 16:36:24 +00:00
|
|
|
return "", common.ErrNotImplementedError
|
|
|
|
}
|