[procps] Re: newlib, ps fix

  • From: Craig Small <csmall-procps@xxxxxxxxxx>
  • To: procps@xxxxxxxxxxxxx
  • Date: Thu, 27 Aug 2015 22:55:12 +1000

On Wed, Aug 26, 2015 at 02:48:35PM -0500, Jim Warner wrote:

In summary, I'm pretty happy with this new pids API state. But what I need
are some other opinions. So, after pushing these changes, why not try your
hand at converting the w program.
So we're lacking in documentation, but that's expected this early in the
piece. So.. question time!

w scans the process table and adds the cpu for processes for
that user. should it be
procps_pids_new
procps_pids_read_open
while procps_pids_read_next
if user match then
add the cpu lines
if best process
copy the fields out of stacks
procps_pids_read_shut
procps_pids_unref

Also why read_open and read_shut? is this to differentiate from the
other access method?

i would of thought the file method would work.
fopen
while fgets
fclose

eg procps_pids_open, procps_pids_read, procps_pids_close



--
Craig Small (@smallsees) http://enc.com.au/ csmall at : enc.com.au
Debian GNU/Linux http://www.debian.org/ csmall at : debian.org
GPG fingerprint: 5D2F B320 B825 D939 04D2 0519 3938 F96B DF50 FEA5

Other related posts: