This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: PATCH: Fix __WORDSIZE for ia64.
On Sat, Aug 02, 2003 at 01:03:51AM +0200, Jakub Jelinek wrote:
> On Fri, Aug 01, 2003 at 04:06:51PM -0700, Dan Kegel wrote:
> > >This doesn't mean much. I don't believe all of them access utmp/wtmp
> > >directly. I will provide old versioned interface so that those who
> > >access utmp/wtmp via libc should work fine.
> >
> > Think so? Check out one of the many *-biarch-utmp.patch files.
> > It looks like you might have to do some work even on programs that
> > go through libc.
> >
> > --- sysvinit-2.83/src/utmp.c.biarch-utmp 2003-04-05
> > 19:17:02.000000000 +0200
> > +++ sysvinit-2.83/src/utmp.c 2003-04-05 19:30:54.000000000 +0200
> > @@ -76,9 +76,17 @@ char *line) /* Which line is this */
> > */
> > memset(&utmp, 0, sizeof(utmp));
> > #if defined(__GLIBC__)
> > - gettimeofday(&utmp.ut_tv, NULL);
> > + if (sizeof (utmp.ut_tv) == sizeof (struct timeval))
> > + gettimeofday((struct timeval *) &utmp.ut_tv, NULL);
> > + else
> > + {
> > + struct timeval tv;
> > + gettimeofday(&tv, NULL);
> > + utmp.ut_tv.tv_sec = tv.tv_sec;
> > + utmp.ut_tv.tv_usec = tv.tv_usec;
> > + }
> > #else
> > - time(&utmp.ut_time);
> > + utmp.ut_time = time(NULL);
> > #endif
> > utmp.ut_pid = pid;
> > utmp.ut_type = type;
>
> No.
> If we claim no binary compatibility for direct access to utmp/wtmp/lastlog
> files (but this would better mean we first write patches for all commonly
> used packages which do direct access), struct utmp/struct wtmp/struct lastlog
> should look for all arches as without __WORDSIZE_COMPAT32 define.
>
It is only a problem for 64 bit platforms which also support 32bit
binaries. I can count ia64, x86-64, ppc64, sparc64 and mips64. As for
alpha, there are no 32bit binaries.
If we fix those programs which assume ut_session is long and ut_tv is
struct timeval, we should be able to cover most cases.
H.J.