From owner-freebsd-current Mon Feb 5 0:50:47 2001 Delivered-To: freebsd-current@freebsd.org Received: from mimer.webgiro.com (unknown [213.162.128.50]) by hub.freebsd.org (Postfix) with ESMTP id 8246D37B6A7 for ; Mon, 5 Feb 2001 00:50:29 -0800 (PST) Received: by mimer.webgiro.com (Postfix, from userid 66) id EC7622DC0F; Mon, 5 Feb 2001 09:56:51 +0100 (CET) Received: by mx.webgiro.com (Postfix, from userid 1001) id 37AF57817; Mon, 5 Feb 2001 09:52:10 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mx.webgiro.com (Postfix) with ESMTP id 2C9FA10E1C; Mon, 5 Feb 2001 09:52:10 +0100 (CET) Date: Mon, 5 Feb 2001 09:52:06 +0100 (CET) From: Andrzej Bialecki To: Bruce Evans Cc: freebsd-current@FreeBSD.ORG Subject: Re: Broken procfs/status, related to kthreads In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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 // 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