1// +build !darwin,!linux,!freebsd,!openbsd,!windows 2 3package process 4 5import ( 6 "context" 7 "syscall" 8 9 "github.com/shirou/gopsutil/cpu" 10 "github.com/shirou/gopsutil/internal/common" 11 "github.com/shirou/gopsutil/net" 12) 13 14type MemoryMapsStat struct { 15 Path string `json:"path"` 16 Rss uint64 `json:"rss"` 17 Size uint64 `json:"size"` 18 Pss uint64 `json:"pss"` 19 SharedClean uint64 `json:"sharedClean"` 20 SharedDirty uint64 `json:"sharedDirty"` 21 PrivateClean uint64 `json:"privateClean"` 22 PrivateDirty uint64 `json:"privateDirty"` 23 Referenced uint64 `json:"referenced"` 24 Anonymous uint64 `json:"anonymous"` 25 Swap uint64 `json:"swap"` 26} 27 28type MemoryInfoExStat struct { 29} 30 31func Pids() ([]int32, error) { 32 return PidsWithContext(context.Background()) 33} 34 35func PidsWithContext(ctx context.Context) ([]int32, error) { 36 return []int32{}, common.ErrNotImplementedError 37} 38 39func Processes() ([]*Process, error) { 40 return nil, common.ErrNotImplementedError 41} 42 43func ProcessesWithContext(ctx context.Context) ([]*Process, error) { 44 return nil, common.ErrNotImplementedError 45} 46 47func NewProcess(pid int32) (*Process, error) { 48 return nil, common.ErrNotImplementedError 49} 50 51func (p *Process) Ppid() (int32, error) { 52 return p.PpidWithContext(context.Background()) 53} 54 55func (p *Process) PpidWithContext(ctx context.Context) (int32, error) { 56 return 0, common.ErrNotImplementedError 57} 58func (p *Process) Name() (string, error) { 59 return p.NameWithContext(context.Background()) 60} 61 62func (p *Process) NameWithContext(ctx context.Context) (string, error) { 63 return "", common.ErrNotImplementedError 64} 65func (p *Process) Tgid() (int32, error) { 66 return 0, common.ErrNotImplementedError 67} 68func (p *Process) Exe() (string, error) { 69 return p.ExeWithContext(context.Background()) 70} 71 72func (p *Process) ExeWithContext(ctx context.Context) (string, error) { 73 return "", common.ErrNotImplementedError 74} 75func (p *Process) Cmdline() (string, error) { 76 return p.CmdlineWithContext(context.Background()) 77} 78 79func (p *Process) CmdlineWithContext(ctx context.Context) (string, error) { 80 return "", common.ErrNotImplementedError 81} 82func (p *Process) CmdlineSlice() ([]string, error) { 83 return p.CmdlineSliceWithContext(context.Background()) 84} 85 86func (p *Process) CmdlineSliceWithContext(ctx context.Context) ([]string, error) { 87 return []string{}, common.ErrNotImplementedError 88} 89func (p *Process) CreateTime() (int64, error) { 90 return p.CreateTimeWithContext(context.Background()) 91} 92 93func (p *Process) CreateTimeWithContext(ctx context.Context) (int64, error) { 94 return 0, common.ErrNotImplementedError 95} 96func (p *Process) Cwd() (string, error) { 97 return p.CwdWithContext(context.Background()) 98} 99 100func (p *Process) CwdWithContext(ctx context.Context) (string, error) { 101 return "", common.ErrNotImplementedError 102} 103func (p *Process) Parent() (*Process, error) { 104 return p.ParentWithContext(context.Background()) 105} 106 107func (p *Process) ParentWithContext(ctx context.Context) (*Process, error) { 108 return nil, common.ErrNotImplementedError 109} 110func (p *Process) Status() (string, error) { 111 return p.StatusWithContext(context.Background()) 112} 113 114func (p *Process) StatusWithContext(ctx context.Context) (string, error) { 115 return "", common.ErrNotImplementedError 116} 117func (p *Process) Uids() ([]int32, error) { 118 return p.UidsWithContext(context.Background()) 119} 120 121func (p *Process) UidsWithContext(ctx context.Context) ([]int32, error) { 122 return []int32{}, common.ErrNotImplementedError 123} 124func (p *Process) Gids() ([]int32, error) { 125 return p.GidsWithContext(context.Background()) 126} 127 128func (p *Process) GidsWithContext(ctx context.Context) ([]int32, error) { 129 return []int32{}, common.ErrNotImplementedError 130} 131func (p *Process) Terminal() (string, error) { 132 return p.TerminalWithContext(context.Background()) 133} 134 135func (p *Process) TerminalWithContext(ctx context.Context) (string, error) { 136 return "", common.ErrNotImplementedError 137} 138func (p *Process) Nice() (int32, error) { 139 return p.NiceWithContext(context.Background()) 140} 141 142func (p *Process) NiceWithContext(ctx context.Context) (int32, error) { 143 return 0, common.ErrNotImplementedError 144} 145func (p *Process) IOnice() (int32, error) { 146 return p.IOniceWithContext(context.Background()) 147} 148 149func (p *Process) IOniceWithContext(ctx context.Context) (int32, error) { 150 return 0, common.ErrNotImplementedError 151} 152func (p *Process) Rlimit() ([]RlimitStat, error) { 153 return p.RlimitWithContext(context.Background()) 154} 155 156func (p *Process) RlimitWithContext(ctx context.Context) ([]RlimitStat, error) { 157 return nil, common.ErrNotImplementedError 158} 159func (p *Process) RlimitUsage(gatherUsed bool) ([]RlimitStat, error) { 160 return p.RlimitUsageWithContext(context.Background(), gatherUsed) 161} 162 163func (p *Process) RlimitUsageWithContext(ctx context.Context, gatherUsed bool) ([]RlimitStat, error) { 164 return nil, common.ErrNotImplementedError 165} 166func (p *Process) IOCounters() (*IOCountersStat, error) { 167 return p.IOCountersWithContext(context.Background()) 168} 169 170func (p *Process) IOCountersWithContext(ctx context.Context) (*IOCountersStat, error) { 171 return nil, common.ErrNotImplementedError 172} 173func (p *Process) NumCtxSwitches() (*NumCtxSwitchesStat, error) { 174 return p.NumCtxSwitchesWithContext(context.Background()) 175} 176 177func (p *Process) NumCtxSwitchesWithContext(ctx context.Context) (*NumCtxSwitchesStat, error) { 178 return nil, common.ErrNotImplementedError 179} 180func (p *Process) NumFDs() (int32, error) { 181 return p.NumFDsWithContext(context.Background()) 182} 183 184func (p *Process) NumFDsWithContext(ctx context.Context) (int32, error) { 185 return 0, common.ErrNotImplementedError 186} 187func (p *Process) NumThreads() (int32, error) { 188 return p.NumThreadsWithContext(context.Background()) 189} 190 191func (p *Process) NumThreadsWithContext(ctx context.Context) (int32, error) { 192 return 0, common.ErrNotImplementedError 193} 194func (p *Process) Threads() (map[int32]*cpu.TimesStat, error) { 195 return p.ThreadsWithContext(context.Background()) 196} 197 198func (p *Process) ThreadsWithContext(ctx context.Context) (map[int32]*cpu.TimesStat, error) { 199 return nil, common.ErrNotImplementedError 200} 201func (p *Process) Times() (*cpu.TimesStat, error) { 202 return p.TimesWithContext(context.Background()) 203} 204 205func (p *Process) TimesWithContext(ctx context.Context) (*cpu.TimesStat, error) { 206 return nil, common.ErrNotImplementedError 207} 208func (p *Process) CPUAffinity() ([]int32, error) { 209 return p.CPUAffinityWithContext(context.Background()) 210} 211 212func (p *Process) CPUAffinityWithContext(ctx context.Context) ([]int32, error) { 213 return nil, common.ErrNotImplementedError 214} 215func (p *Process) MemoryInfo() (*MemoryInfoStat, error) { 216 return p.MemoryInfoWithContext(context.Background()) 217} 218 219func (p *Process) MemoryInfoWithContext(ctx context.Context) (*MemoryInfoStat, error) { 220 return nil, common.ErrNotImplementedError 221} 222func (p *Process) MemoryInfoEx() (*MemoryInfoExStat, error) { 223 return p.MemoryInfoExWithContext(context.Background()) 224} 225 226func (p *Process) MemoryInfoExWithContext(ctx context.Context) (*MemoryInfoExStat, error) { 227 return nil, common.ErrNotImplementedError 228} 229func (p *Process) Children() ([]*Process, error) { 230 return p.ChildrenWithContext(context.Background()) 231} 232 233func (p *Process) ChildrenWithContext(ctx context.Context) ([]*Process, error) { 234 return nil, common.ErrNotImplementedError 235} 236func (p *Process) OpenFiles() ([]OpenFilesStat, error) { 237 return p.OpenFilesWithContext(context.Background()) 238} 239 240func (p *Process) OpenFilesWithContext(ctx context.Context) ([]OpenFilesStat, error) { 241 return []OpenFilesStat{}, common.ErrNotImplementedError 242} 243func (p *Process) Connections() ([]net.ConnectionStat, error) { 244 return p.ConnectionsWithContext(context.Background()) 245} 246 247func (p *Process) ConnectionsWithContext(ctx context.Context) ([]net.ConnectionStat, error) { 248 return []net.ConnectionStat{}, common.ErrNotImplementedError 249} 250func (p *Process) NetIOCounters(pernic bool) ([]net.IOCountersStat, error) { 251 return p.NetIOCountersWithContext(context.Background(), pernic) 252} 253 254func (p *Process) NetIOCountersWithContext(ctx context.Context, pernic bool) ([]net.IOCountersStat, error) { 255 return []net.IOCountersStat{}, common.ErrNotImplementedError 256} 257func (p *Process) IsRunning() (bool, error) { 258 return p.IsRunningWithContext(context.Background()) 259} 260 261func (p *Process) IsRunningWithContext(ctx context.Context) (bool, error) { 262 return true, common.ErrNotImplementedError 263} 264func (p *Process) MemoryMaps(grouped bool) (*[]MemoryMapsStat, error) { 265 return p.MemoryMapsWithContext(context.Background(), grouped) 266} 267 268func (p *Process) MemoryMapsWithContext(ctx context.Context, grouped bool) (*[]MemoryMapsStat, error) { 269 return nil, common.ErrNotImplementedError 270} 271func (p *Process) SendSignal(sig syscall.Signal) error { 272 return p.SendSignalWithContext(context.Background(), sig) 273} 274 275func (p *Process) SendSignalWithContext(ctx context.Context, sig syscall.Signal) error { 276 return common.ErrNotImplementedError 277} 278func (p *Process) Suspend() error { 279 return p.SuspendWithContext(context.Background()) 280} 281 282func (p *Process) SuspendWithContext(ctx context.Context) error { 283 return common.ErrNotImplementedError 284} 285func (p *Process) Resume() error { 286 return p.ResumeWithContext(context.Background()) 287} 288 289func (p *Process) ResumeWithContext(ctx context.Context) error { 290 return common.ErrNotImplementedError 291} 292func (p *Process) Terminate() error { 293 return p.TerminateWithContext(context.Background()) 294} 295 296func (p *Process) TerminateWithContext(ctx context.Context) error { 297 return common.ErrNotImplementedError 298} 299func (p *Process) Kill() error { 300 return p.KillWithContext(context.Background()) 301} 302 303func (p *Process) KillWithContext(ctx context.Context) error { 304 return common.ErrNotImplementedError 305} 306func (p *Process) Username() (string, error) { 307 return p.UsernameWithContext(context.Background()) 308} 309 310func (p *Process) UsernameWithContext(ctx context.Context) (string, error) { 311 return "", common.ErrNotImplementedError 312} 313