PATCH: Fix __WORDSIZE for ia64.

Dan Kegel dank@kegel.com
Fri Aug 1 22:59:00 GMT 2003


H. J. Lu wrote:
 > Gwenole wrote:
>>   - Because of the new struct utmp layout, the following packages had
>>     to be fixed and/or rebuilt: adjtimex, aterm, dietlibc, dump,
>>     emacs, fileutils, findutils, finger, getty_ps, gkrellm,
>>     gnome-libs, gpm, hylafax, kdeadmin, kdebase, kdenetwork,
>>     kdevelop, krb5, libzvt, linuxconf, man-pages, mgetty, mingetty,
>>     mod_auth_external, ncpfs, ntp, openssh, pam, procps, proftpd,
>>     psacct, pwdb, rwho, rxvt, samba, screen, shadow-utils, sh-utils,
>>     sysklogd, SysVinit, talk, tcsh, utempter, util-linux, xterm, zsh,
>>     XFree86.
>> Once I get time, I will check those not yet sent upstream. Or, in the  mean time, you can check:
>> http://cvs.mandrakesoft.com/cgi-bin/cvsweb.cgi/SPECS/<package-name>/*- biarch-utmp.patch 
>
> 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;
@@ -144,9 +152,17 @@ char *oldline)			/* Line of old utmp ent
  	utmp.ut_pid = pid;
  	strncpy(utmp.ut_id, id, sizeof(utmp.ut_id));
  #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
  	strncpy(utmp.ut_user, user, UT_NAMESIZE);
  	if (line) strncpy(utmp.ut_line, line, UT_LINESIZE);


-- 
Dan Kegel
http://www.kegel.com
http://counter.li.org/cgi-bin/runscript/display-person.cgi?user=78045



More information about the Libc-alpha mailing list