Subject: Re: CVS commit: src/usr.bin/who
To: None <current-users@netbsd.org>
From: Tom Spindler <dogcow@babymeat.com>
List: current-users
Date: 09/20/2006 09:59:40
> On Sep 20, 2:53pm, hubert@feyrer.de (Hubert Feyrer) wrote:
> -- Subject: Re: CVS commit: src/usr.bin/who
>
> | On Wed, 20 Sep 2006, Elad Efrat wrote:
> | > While it is noble that it cares, I think we can safely deprecate it,
> | > keeping the config file and the parser for compliance.
> |
> | No - it's a nice example of how to allow users to run a program only at
> | several times.
> |
> | I didn't know that the who-sources are used in other places when I
> | committed the change to who(1). I'll have a look within the next few days
> | (I'm mostly offline right now).
>
> Lots of things use it (everything that needs utmp). I meant to move it
> to libutil, but I am not happy with the API yet.
I was looking at some of the various programs that use utmpentry.h,
and some of the things they do are... not obvious.
The (obvious/small) code fragment
struct utmpx *u; int nusers;
for (nusers = 0; NULL != (u = getutxent());) {
if (*u->ut_name) nusers++;
}
gives a different number of users than who(1) does. Without descending
too far into madness^Wthe who(1) code, how are its (or rpc.rusersd)
criteria different than what utmpx keeps track of?
For that matter, there's a whole bunch of #ifdef SUPPORT_UTMP and
#ifdef SUPPORT_UTMPX code in who.c; are they really needed?