Subject: Inconsistency in libc lastlogx functions
To: None <>
From: Thomas Klausner <>
List: tech-userlevel
Date: 09/29/2002 01:33:10

While writing man pages for the additional (newly invented) lastlogx
support functions in libc, I found the following inconsistency:

int              lastlogxname __P((const char *));
struct lastlogx *getlastlogx __P((uid_t, struct lastlogx *));
int              updlastlogx __P((const char *, uid_t, struct lastlogx *));

Please note that updlastlogx takes a file name for the lastlogx file
it should update, while getlastlogx uses the default name or the one
set by lastlogxname.

For comparison, the utmpx interface functions all use the default
filename, or the one set by utmpxname, and the wtmpx functions (1 so
far ;) all have a filename argument.

I think this should be fixed to give getlastlogx a file name too, and
remove the lastlogxname function (christos agrees), like this:

struct lastlogx *getlastlogx __P((const char *, uid_t, struct lastlogx *));
int updlastlogx __P((const char *, uid_t, struct lastlogx *));

The problem with this approach is that the functions are in libc, and
changing them would need a major bump, or a rename hack. Or we could
just remove them; since they were only added on July 27 (after
branching 1.6), and we "invented" the interface, approximately no
third-party software should be using it yet, so we could just fudge it
without using either of the two solutions from above (perhaps a minor

What do people think?

Thomas Klausner -
Main Rule of Usenet:  Never argue with idiots.  They drag you down to
their level, then beat you with experience.