Date: Mon, 5 Feb 2001 09:52:06 +0100 (CET) From: Andrzej Bialecki <abial@webgiro.com> To: Bruce Evans <bde@zeta.org.au> Cc: freebsd-current@FreeBSD.ORG Subject: Re: Broken procfs/status, related to kthreads Message-ID: <Pine.BSF.4.20.0102050937580.1255-100000@mx.webgiro.com> In-Reply-To: <Pine.BSF.4.21.0102050925130.13309-100000@besplex.bde.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 5 Feb 2001, Bruce Evans wrote: > On Sun, 4 Feb 2001, Andrzej Bialecki wrote: > > > According to procfs(5), the status line contains several well-defined > > fields separated by spaces. However, the kernel thread names look like > > 'swi5: task queue' and 'swi1: net', which results in variable number of > > space-separated fields. As a consequence, some software that parses this > > line gives incorrect results. > > I think procfs never actually implemented this. Program names may > have spaces in them too. Of course, the line is too hard to parse if > the first "field" has spaces in it. Only MAXCOMLEN and NAME_MAX > prevent the command name being the contents of another process's > status line :-). Ok, then how should this be fixed? We could escape the space characters with something: swi5:$task$queue 14 0 0 0 -1,-1 noflags 981365276,40 0,0 0,0 nochan 0 0 0,0 - and for command name 'my$prog': my$$prog 334 1 332 0 -1,-1 noflags 981361691,37404 0,0 0,5748 select 0 0 0,0 - or similar... The commands with $ in them are much less likely than the names with spaces, which on -current are guaranteed to occur. Andrzej Bialecki // <abial@webgiro.com> WebGiro AB, Sweden (http://www.webgiro.com) // ------------------------------------------------------------------- // ------ FreeBSD: The Power to Serve. http://www.freebsd.org -------- // --- Small & Embedded FreeBSD: http://www.freebsd.org/~picobsd/ ---- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.20.0102050937580.1255-100000>