提交 a00c5af8 编写于 作者: S Shirou WAKAYAMA

process[linux]: return up-to-date information when invoked.

上级 e10ccf99
......@@ -97,12 +97,24 @@ func (p *Process) Parent() (*Process, error) {
return nil, common.NotImplementedError
}
func (p *Process) Status() (string, error) {
err := p.fillFromStatus()
if err != nil {
return "", err
}
return p.status, nil
}
func (p *Process) Uids() ([]int32, error) {
err := p.fillFromStatus()
if err != nil {
return []int32{}, err
}
return p.uids, nil
}
func (p *Process) Gids() ([]int32, error) {
err := p.fillFromStatus()
if err != nil {
return []int32{}, err
}
return p.gids, nil
}
func (p *Process) Terminal() (string, error) {
......@@ -129,6 +141,10 @@ func (p *Process) IOCounters() (*IOCountersStat, error) {
return p.fillFromIO()
}
func (p *Process) NumCtxSwitches() (*NumCtxSwitchesStat, error) {
err := p.fillFromStatus()
if err != nil {
return nil, err
}
return p.numCtxSwitches, nil
}
func (p *Process) NumFDs() (int32, error) {
......@@ -136,6 +152,10 @@ func (p *Process) NumFDs() (int32, error) {
return numFds, err
}
func (p *Process) NumThreads() (int32, error) {
err := p.fillFromStatus()
if err != nil {
return 0, err
}
return p.numThreads, nil
}
func (p *Process) Threads() (map[string]string, error) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册