Last problem -- int vs. long
goldberg at uiucdcs.CS.UIUC.EDU
goldberg at uiucdcs.CS.UIUC.EDU
Fri Feb 21 09:46:00 AEST 1986
Date: Thu, 20 Feb 86 10:53:16 cst
From: stevea at uiphysed.PE.UIUC.EDU (Steve Alexander)
To: goldberg at a.cs.uiuc.edu
Subject: bug report, please post to bugs.2bsd
Subject: Last won't work with more than 128 utmp records
Index: ucb/last.c 2.9bsd (Harvard/CSS) Fix
Description:
Last was moved from a VAX where sizeof(int) == sizeof(long). This
breaks on a PDP-11, because lseek is being called with a 16-bit
offset.
Repeat-By:
Wait for your /usr/adm/wtmp file to grow larger than 4608 bytes,
which is 128 struct utmps.
Run last, noticing that it does not reflect current system status.
Flame about Berkeley, and their aversion to lint.
Fix:
In last.c, routine main, in the lseek call, cast the expression
(bl * sizeof(buf)) to a long. Flame some more.
More information about the Comp.bugs.2bsd
mailing list