Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 5 Jul 1997 11:39:19 -0700 (MST)
From:      Terry Lambert <terry@lambert.org>
To:        ache@nagual.pp.ru (=?KOI8-R?B?4c7E0sXKIP7F0s7P1w==?=)
Cc:        davidn@labs.usn.blaze.net.au, wosch@apfel.de, current@FreeBSD.ORG
Subject:   Re: long usernames in top
Message-ID:  <199707051839.LAA14837@phaeton.artisoft.com>
In-Reply-To: <Pine.BSF.3.96.970705161359.545A-100000@nagual.pp.ru> from "=?KOI8-R?B?4c7E0sXKIP7F0s7P1w==?=" at Jul 5, 97 04:16:38 pm

next in thread | previous in thread | raw e-mail | index | archive | help
[ ... 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.



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