From ab50ecbd8f35c1c1197204546efcfdd655a53580 Mon Sep 17 00:00:00 2001 From: WAKAYAMA shirou Date: Mon, 28 Apr 2014 15:39:01 +0900 Subject: [PATCH] change freebsd according to Process interface changes. --- process_freebsd.go | 99 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 97 insertions(+), 2 deletions(-) diff --git a/process_freebsd.go b/process_freebsd.go index 1fce618..49dcaaf 100644 --- a/process_freebsd.go +++ b/process_freebsd.go @@ -30,14 +30,109 @@ func Pids() ([]int32, error) { return ret, nil } + +func (p *Process) Ppid() (int32, error) { + return 0, nil +} +func (p *Process) Name() (string, error) { + name := "" + return name, nil +} +func (p *Process) Exe() (string, error) { + return "", nil +} +func (p *Process) Cmdline() (string, error) { + return "", nil +} +func (p *Process) Cwd() (string, error) { + return "", nil +} +func (p *Process) Parent() (*Process, error) { + return p, nil +} +func (p *Process) Status() (string, error) { + return "", nil +} +func (p *Process) Username() (string, error) { + return "", nil +} +func (p *Process) Uids() ([]int32, error) { + uids := make([]int32, 0) + return uids, nil +} +func (p *Process) Gids() ([]int32, error) { + gids := make([]int32, 0) + return gids, nil +} +func (p *Process) Terminal() (string, error) { + return "", nil +} +func (p *Process) Nice() (int32, error) { + return 0, nil +} +func (p *Process) Ionice() (int32, error) { + return 0, nil +} +func (p *Process) Rlimit() ([]RlimitStat, error) { + rlimit := make([]RlimitStat, 0) + return rlimit, nil +} +func (p *Process) Io_counters() (*Io_countersStat, error) { + return nil, nil +} +func (p *Process) Num_ctx_switches() (int32, error) { + return 0, nil +} +func (p *Process) Num_fds() (int32, error) { + return 0, nil +} +func (p *Process) Num_Threads() (int32, error) { + return 0, nil +} +func (p *Process) Threads() (map[string]string, error) { + ret := make(map[string]string, 0) + return ret, nil +} +func (p *Process) Cpu_times() (*CPU_TimesStat, error) { + return nil, nil +} +func (p *Process) Cpu_percent() (int32, error) { + return 0, nil +} +func (p *Process) Cpu_affinity() ([]int32, error) { + return nil, nil +} +func (p *Process) Memory_info() (*Memory_infoStat, error) { + return nil, nil +} +func (p *Process) Memory_info_ex() (*Memory_info_exStat, error) { + return nil, nil +} +func (p *Process) Memory_percent() (float32, error) { + return 0, nil +} + +func (p *Process) Children() ([]*Process, error) { + return nil, nil +} + +func (p *Process) Open_files() ([]Open_filesStat, error) { + return nil, nil +} + +func (p *Process) Connections() ([]Net_connectionStat, error) { + return nil, nil +} + +func (p *Process) Is_running() (bool, error) { + return true, nil +} func (p *Process) Memory_Maps() (*[]Memory_mapsStat, error) { ret := make([]Memory_mapsStat, 0) return &ret, nil } func copy_params(k *Kinfo_proc, p *Process) error { - p.Exe = byteToString(k.Ki_comm[:]) - p.Ppid = k.Ki_ppid return nil }