pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: pkg/45741: tcsh doesn't understand 64bit time_t



The following reply was made to PR pkg/45741; it has been noted by GNATS.

From: David Holland <dholland-pbugs%netbsd.org@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: pkg/45741: tcsh doesn't understand 64bit time_t
Date: Sun, 25 Dec 2011 12:46:05 +0000

 On Sun, Dec 25, 2011 at 12:40:05PM +0000, Michael van Elst wrote:
  >  On Sun, Dec 25, 2011 at 12:15:04PM +0000, David Holland wrote:
  >  >  On Sun, Dec 25, 2011 at 10:10:01AM +0000, mlelstv%serpens.de@localhost 
wrote:
  >  >   > tcsh 6.17 prints bad values for user and system time. This is caused
  >  >   > by the change to 64bit time_t values in NetBSD.
  >  >  
  >  >  Is that a compat problem or a native problem? (that is, did you build
  >  >  the tcsh before or after the time_t switch?)
  >  
  >  Of course after.
 
 It wasn't obvious, a still-undiscovered compat problem is hardly
 impossible.
 
  >  The problem is that printf is called with a format string
  >  denoting a 'long' value, but gets passed a parameter that is
  >  'time_t'. This works fine unless 'time_t' is larger than 'long'.
  >  
  >  Casting the parameters to 'long' helps unless the value
  >  printed doesn't fit into a 'long' (i.e. rusage is more than
  >  2^31 seconds == 68 years CPU time).
  >  
  >  If you want to support larger rusage values, the format string
  >  needs to be adapted. But that might have portability issues for
  >  tcsh.
 
 ah.
 
 Well, I don't think there's any need to worry about 68 years CPU time
 for at least the near future. Maybe when 1024-way machines become
 common...
 
 -- 
 David A. Holland
 dholland%netbsd.org@localhost
 


Home | Main Index | Thread Index | Old Index