From owner-freebsd-current Sat Jul 5 11:44:31 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id LAA15152 for current-outgoing; Sat, 5 Jul 1997 11:44:31 -0700 (PDT) Received: from phaeton.artisoft.com (phaeton.Artisoft.COM [198.17.250.50]) by hub.freebsd.org (8.8.5/8.8.5) with SMTP id LAA15147 for ; Sat, 5 Jul 1997 11:44:28 -0700 (PDT) Received: (from terry@localhost) by phaeton.artisoft.com (8.6.11/8.6.9) id LAA14837; Sat, 5 Jul 1997 11:39:19 -0700 From: Terry Lambert Message-Id: <199707051839.LAA14837@phaeton.artisoft.com> Subject: Re: long usernames in top To: ache@nagual.pp.ru (=?KOI8-R?B?4c7E0sXKIP7F0s7P1w==?=) Date: Sat, 5 Jul 1997 11:39:19 -0700 (MST) Cc: davidn@labs.usn.blaze.net.au, wosch@apfel.de, current@FreeBSD.ORG In-Reply-To: from "=?KOI8-R?B?4c7E0sXKIP7F0s7P1w==?=" at Jul 5, 97 04:16:38 pm X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-current@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk [ ... go through entire passwd database ... ] > > Use this to determine the maximum name. 8 is an obvious minimum, and > > do this at startup. If larger names are added while top is running, > > well, tough, they get truncated which is no big deal. > > Better variant will be to calculate maxnamelen at runtime through > displayed names only, not through all names from /etc/passwd Yes. This is what I did for "ps" and "w". The annoying thing about top is that the name data is potentially variant on each refresh. Plus the thing is being actively maintained by an agency other than FreeBSD, so unless the job was done completely, it's likely that it would become a FreeBSD-only maintenance nightmare. > Otherwise you'll get wide output even if only one long user name present > in your /etc/passwd (even this userid is never really used). Plus you will get hammered on the large databases (as has already been mentioned). It's not so annoying that you are hitting all the entries as it is that it takes so long to do it, and you get the wrong runtime answer after all that effort anyway. Regards, Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers.