From 37d89088411de59a4ef9fc340afa0e89dfcb4ea9 Mon Sep 17 00:00:00 2001 From: WAKAYAMA shirou Date: Thu, 31 Mar 2016 17:32:24 +0900 Subject: [PATCH] [process]freebsd: implementes proceess.Nice() --- README.rst | 4 ++-- process/process_freebsd.go | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index d363c49..16a8090 100644 --- a/README.rst +++ b/README.rst @@ -179,8 +179,8 @@ exe x x x uids x x x gids x x x terminal x x x -io_counters x -nice x x x +io_counters x x +nice x x x x num_fds x num_ctx_switches x num_threads x x x x diff --git a/process/process_freebsd.go b/process/process_freebsd.go index aae6892..94c0a32 100644 --- a/process/process_freebsd.go +++ b/process/process_freebsd.go @@ -163,7 +163,11 @@ func (p *Process) Terminal() (string, error) { return termmap[ttyNr], nil } func (p *Process) Nice() (int32, error) { - return 0, common.NotImplementedError + k, err := p.getKProc() + if err != nil { + return 0, err + } + return int32(k.Nice), nil } func (p *Process) IOnice() (int32, error) { return 0, common.NotImplementedError