Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 18 Aug 2001 20:50:01 -0400 (EDT)
From:      Dan Ellard <ellard@eecs.harvard.edu>
To:        Josef Karthauser <joe@tao.org.uk>
Cc:        <freebsd-fs@FreeBSD.ORG>, Dan Ellard <ellard@eecs.harvard.edu>
Subject:   Re: parsing problem with /proc/N/status
Message-ID:  <20010818204221.I75599-100000@capybara.eecs.harvard.edu>
In-Reply-To: <20010817102549.A712@tao.org.uk>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 17 Aug 2001, Josef Karthauser wrote:

> I've raised PR29682 about a problem parsing /proc/N/status (procfs) in
> -current.  The problem occurs when process names contain spaces, like
> all of the 'irqN: xxx' ones do.  Is there a procfs guru here that would
> mind taking a look for me?

I'm nearly as far as possible from being a guru in this area...
But after reading through the man page, it looks like the only field
you need to worry about containing spaces is the first field.  If this
is true, then if you parse the string *backwards*, after you've
plucked out all the other fields, whatever remains is the command
name.  (The value from procfs should consist of 11+x tokens (where x >
0).  The last 11 match up with the last 11 fields, and the first x get
combined to form the command name.)

-Dan



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-fs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010818204221.I75599-100000>