Subject: Re: increasing UT_HOSTSIZE for IPv6?
To: Chris Torek <torek@BSDI.COM>
From: Dan Winship <danw@MIT.EDU>
List: tech-userlevel
Date: 07/23/1999 14:15:26
utmpx isn't text-based or dynamically allocated, it just has bigger
fields. On this Irix box:

struct utmp
  {
        char ut_user[8] ;
        char ut_id[4] ;
        char ut_line[12] ;
        short ut_pid ;
        short ut_type ;
        struct __exit_status ut_exit ;
        time_t ut_time ;
  } ;

struct utmpx
  {
        char            ut_user[32];
        char            ut_id[4];
        char            ut_line[32];
        pid_t           ut_pid;
        short           ut_type;
        struct __exit_status ut_exit;
        struct timeval  ut_tv;
        long            ut_session;
        long            ut_pad[5];
        short           ut_syslen;
        char            ut_host[257];
  } ;


Oops. That was probably unpublished proprietary source code of AT&T or
something.

And then you have pututxline, getutxent, etc like the utmp versions
(which I think actually NetBSD doesn't have?), or you can read() and
write() the utmpx file in sizeof(struct utmpx) chunks.

Using utmpx would also let us fix the 8-character username problem in
utmp...

-- Dan