NetBSD Problem Report #49144

From gson@gson.org  Sat Aug 23 17:16:04 2014
Return-Path: <gson@gson.org>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 98F7AAED83
	for <gnats-bugs@gnats.NetBSD.org>; Sat, 23 Aug 2014 17:16:04 +0000 (UTC)
Message-Id: <20140823171557.71B1275E30@guava.gson.org>
Date: Sat, 23 Aug 2014 20:15:57 +0300 (EEST)
From: gson@gson.org (Andreas Gustafsson)
Reply-To: gson@gson.org (Andreas Gustafsson)
To: gnats-bugs@gnats.NetBSD.org
Subject: udf_times test takes 951 times longer on i386 than amd64
X-Send-Pr-Version: 3.95

>Number:         49144
>Category:       bin
>Synopsis:       udf_times test takes 951 times longer on i386 than amd64
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Aug 23 17:20:00 +0000 2014
>Closed-Date:    Tue Sep 09 10:48:35 +0000 2014
>Last-Modified:  Wed Nov 12 18:55:00 +0000 2014
>Originator:     Andreas Gustafsson
>Release:        NetBSD-current
>Organization:

>Environment:
System: NetBSD
Architecture: i386
Machine: i386
>Description:

This is a strange one...

The fs/vfs/t_unpriv/udf_times test case takes hundreds of times 
longer to run on NetBSD/i386 than it does on NetBSD/amd64.

Here is the atf-report output from running the test on NetBSD/amd64
and NetBSD/i386, both built from identical sources (-current CVS date
2014.08.17.20.22.41) and running on the same physical machine (an AMD
Athlon 64), on the bare metal:

  amd64:     udf_times: [0.086259s] Passed.
  i386:      udf_times: [82.081873s] Passed.

That's 951 times longer on i386 than amd64.

When running under qemu on the TNF testbed, both tests run a lot
slower as you would expect, and there, too, the i386 runs take
hundreds of times longer than the amd64 ones.  As a result, they
sometimes exceed the ATF timeout and fail.  On qemu/sparc, the tests
run about as fast as they do on qemu/amd64, so this does not look like
a 32-bit vs 64-bit issue.

According to the logs, the problem has existed at least since CVS date
2013.07.02.15.05.53, which was the first time the udf_times test ran
on babylon5 without running into other problems first.

>How-To-Repeat:

Run the ATF tests on i386.  Notice how the fs/vfs/t_unpriv/udf_times
test case takes minutes rather than milliseconds it takes on other
architectures.

>Fix:

>Release-Note:

>Audit-Trail:
From: "Andreas Gustafsson" <gson@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/49144 CVS commit: src/tests/fs/vfs
Date: Fri, 29 Aug 2014 17:39:18 +0000

 Module Name:	src
 Committed By:	gson
 Date:		Fri Aug 29 17:39:18 UTC 2014

 Modified Files:
 	src/tests/fs/vfs: t_unpriv.c

 Log Message:
 Don't pass an uninitialized variable as the times[] argument of
 rump_sys_utimes().  Instead, pass combinations of values representing
 edge cases: the farthest possible past, the epoch, and the farthest
 possible future.  Now the excessive runtime reported in PR bin/49144
 occurs reliably, on multiple architectures, and not only with udf, but
 also with msdosfs.


 To generate a diff of this commit:
 cvs rdiff -u -r1.10 -r1.11 src/tests/fs/vfs/t_unpriv.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@NetBSD.org
Cc: Andreas Gustafsson <gson@gson.org>
Subject: Re: PR/49144 CVS commit: src/tests/fs/vfs
Date: Fri, 29 Aug 2014 20:44:47 +0200

 Good catch!

 #0  0x00007f7ff6c0e6b9 in unix2dostime (tsp=0x7f7fffffd6f8, 
     gmtoff=<optimized out>, ddp=0x7f7ff7733e5a, dtp=0x0, dhp=0x0)
     at /usr/src/sys/rump/fs/lib/libmsdos/../../../../fs/msdosfs/msdosfs_conv.c:139
 #1  0x00007f7ff6c07a98 in msdosfs_setattr (v=0x7f7fffffd660)
     at /usr/src/sys/rump/fs/lib/libmsdos/../../../../fs/msdosfs/msdosfs_vnops.c:387
 #2  0x00007f7ff2c5975f in VOP_SETATTR (vp=0x7f7ff7734cc0, vap=<optimized out>, 
     cred=<optimized out>)
     at /usr/src/lib/librump/../../sys/rump/../kern/vnode_if.c:362
 #3  0x00007f7ff3038048 in do_sys_utimensat (l=l@entry=0x7f7ff73ba800, 
     fdat=fdat@entry=-100, vp=0x7f7ff7734cc0, vp@entry=0x0, 
     path=path@entry=0x41b0aa "file.test", flag=<optimized out>, 
     tptr=<optimized out>, seg=seg@entry=UIO_SYSSPACE)
     at /usr/src/lib/librumpvfs/../../sys/rump/../kern/vfs_syscalls.c:3858
 (gdb) list
 144                             months = year & 0x03 ? regyear : leapyear;
 145                             for (month = 0; month < 12; month++) {
 146                                     if (days < months[month])
 147                                             break;
 148                                     days -= months[month];
 149                             }
 150                             lastddate = ((days + 1) << DD_DAY_SHIFT)
 151                                 + ((month + 1) << DD_MONTH_SHIFT);


  ;-}

 Martin

From: John Nemeth <jnemeth@cue.bc.ca>
To: gnats-bugs@NetBSD.org, gnats-admin@NetBSD.org, netbsd-bugs@NetBSD.org,
        gson@gson.org (Andreas Gustafsson)
Cc: 
Subject: Re: PR/49144 CVS commit: src/tests/fs/vfs
Date: Fri, 29 Aug 2014 14:02:19 -0700

 On Aug 29,  6:45pm, Martin Husemann wrote:
 }
 } The following reply was made to PR bin/49144; it has been noted by GNATS.
 } 
 } From: Martin Husemann <martin@duskware.de>
 } To: gnats-bugs@NetBSD.org
 } Cc: Andreas Gustafsson <gson@gson.org>
 } Subject: Re: PR/49144 CVS commit: src/tests/fs/vfs
 } Date: Fri, 29 Aug 2014 20:44:47 +0200
 } 
 }  Good catch!
 }  
 }  [snip]
 } 
 }  (gdb) list
 }  144                             months = year & 0x03 ? regyear : leapyear;

      This is also wrong.  The correct formula for computing leap
 years is year divisible 4, but if year is divisible by 100, then
 it must also be divisible by 400.  I.e. 2000 was a leap year, but
 2100 won't be.  Of course, in practice this probably doesn't matter.
 And, of course, the calendar might change again sometime in the
 next 986 years.

 }  145                             for (month = 0; month < 12; month++) {
 }  146                                     if (days < months[month])
 }  147                                             break;
 }  148                                     days -= months[month];
 }  149                             }
 }  150                             lastddate = ((days + 1) << DD_DAY_SHIFT)
 }  151                                 + ((month + 1) << DD_MONTH_SHIFT);
 }  
 }  
 }   ;-}
 }  
 }  Martin
 }  
 }-- End of excerpt from Martin Husemann

From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@NetBSD.org
Cc: Andreas Gustafsson <gson@gson.org>
Subject: Re: PR/49144 CVS commit: src/tests/fs/vfs
Date: Sat, 30 Aug 2014 17:33:28 +0200

 I was going to suggest something like the below (untested) change and then
 only make sure that the todr(9) helper functions perform well, but
 that breaks the tool compilation of makefs (which can do -t msdos).

 UDF already uses the todr(9) functions directly.
 At least this patch avoids threading issues with the caching done in
 msdofs.

 Suggestions how to best "toolify" sys/dev/clock_subr.c ?

 Martin

 Index: msdosfs_conv.c
 ===================================================================
 RCS file: /cvsroot/src/sys/fs/msdosfs/msdosfs_conv.c,v
 retrieving revision 1.9
 diff -u -p -r1.9 msdosfs_conv.c
 --- msdosfs_conv.c	26 Jan 2013 16:51:51 -0000	1.9
 +++ msdosfs_conv.c	30 Aug 2014 15:28:29 -0000
 @@ -64,6 +64,7 @@ __KERNEL_RCSID(0, "$NetBSD: msdosfs_conv
  #include <sys/systm.h>
  #include <sys/kernel.h>
  #include <sys/vnode.h>
 +#include <dev/clock_subr.h>
  #else
  #include <stdio.h>
  #include <dirent.h>
 @@ -77,29 +78,10 @@ __KERNEL_RCSID(0, "$NetBSD: msdosfs_conv
  #include <fs/msdosfs/denode.h>

  /*
 - * Days in each month in a regular year.
 - */
 -u_short const regyear[] = {
 -	31, 28, 31, 30, 31, 30,
 -	31, 31, 30, 31, 30, 31
 -};
 -
 -/*
 - * Days in each month in a leap year.
 - */
 -u_short const leapyear[] = {
 -	31, 29, 31, 30, 31, 30,
 -	31, 31, 30, 31, 30, 31
 -};
 -
 -/*
 - * Variables used to remember parts of the last time conversion.  Maybe we
 - * can avoid a full conversion.
 + * The number of seconds between Jan 1, 1970 and Jan 1, 1980. In that
 + * interval there were 8 regular years and 2 leap years.
   */
 -u_long lasttime;
 -u_long lastday;
 -u_short lastddate;
 -u_short lastdtime;
 +#define	SECONDSTO1980	(((8 * 365) + (2 * 366)) * (24 * 60 * 60))

  /*
   * Convert the unix version of time to dos's idea of time to be used in
 @@ -109,74 +91,47 @@ void
  unix2dostime(const struct timespec *tsp, int gmtoff, u_int16_t *ddp, u_int16_t *dtp, u_int8_t *dhp)
  {
  	u_long t;
 -	u_long days;
 -	u_long inc;
 -	u_long year;
 -	u_long month;
 -	const u_short *months;
 +	struct clock_ymdhms ymd;
 +
 +	t = tsp->tv_sec + gmtoff; /* time zone correction */

  	/*
 -	 * If the time from the last conversion is the same as now, then
 -	 * skip the computations and use the saved result.
 +	 * DOS timestamps can not represent dates before 1980.
 +	 */
 +	if (t < SECONDSTO1980) {
 +		*ddp = 0;
 +		if (dtp)
 +			*dtp = 0;
 +		if (dhp)
 +			*dhp = 0;
 +		return;
 +	}
 +
 +	/*
 +	 * DOS granularity is 2 seconds
  	 */
 -	t = tsp->tv_sec + gmtoff; /* time zone correction */
  	t &= ~1;
 -	if (lasttime != t) {
 -		lasttime = t;
 -		lastdtime = (((t / 2) % 30) << DT_2SECONDS_SHIFT)
 -		    + (((t / 60) % 60) << DT_MINUTES_SHIFT)
 -		    + (((t / 3600) % 24) << DT_HOURS_SHIFT);

 -		/*
 -		 * If the number of days since 1970 is the same as the last
 -		 * time we did the computation then skip all this leap year
 -		 * and month stuff.
 -		 */
 -		days = t / (24 * 60 * 60);
 -		if (days != lastday) {
 -			lastday = days;
 -			for (year = 1970;; year++) {
 -				inc = year & 0x03 ? 365 : 366;
 -				if (days < inc)
 -					break;
 -				days -= inc;
 -			}
 -			months = year & 0x03 ? regyear : leapyear;
 -			for (month = 0; month < 12; month++) {
 -				if (days < months[month])
 -					break;
 -				days -= months[month];
 -			}
 -			lastddate = ((days + 1) << DD_DAY_SHIFT)
 -			    + ((month + 1) << DD_MONTH_SHIFT);
 -			/*
 -			 * Remember dos's idea of time is relative to 1980.
 -			 * unix's is relative to 1970.  If somehow we get a
 -			 * time before 1980 then don't give totally crazy
 -			 * results.
 -			 */
 -			if (year > 1980)
 -				lastddate += (year - 1980) << DD_YEAR_SHIFT;
 -		}
 -	}
 -	if (dtp)
 -		*dtp = lastdtime;
 +	/*
 +	 * Convert to year/month/day/.. format
 +	 */
 +	clock_secs_to_ymdhms(t, &ymd);
 +
 +	/*
 +	 * Now transform to DOS format
 +	 */
 +	*ddp = (ymd.dt_day << DD_DAY_SHIFT)
 +	    + (ymd.dt_mon << DD_MONTH_SHIFT)
 +	    + ((ymd.dt_year - 1980) << DD_YEAR_SHIFT);
  	if (dhp)
  		*dhp = (tsp->tv_sec & 1) * 100 + tsp->tv_nsec / 10000000;
 -
 -	*ddp = lastddate;
 +	if (dtp)
 +		*dtp = (((t / 2) % 30) << DT_2SECONDS_SHIFT)
 +		    + (((t / 60) % 60) << DT_MINUTES_SHIFT)
 +		    + (((t / 3600) % 24) << DT_HOURS_SHIFT);
  }

  /*
 - * The number of seconds between Jan 1, 1970 and Jan 1, 1980. In that
 - * interval there were 8 regular years and 2 leap years.
 - */
 -#define	SECONDSTO1980	(((8 * 365) + (2 * 366)) * (24 * 60 * 60))
 -
 -u_short lastdosdate;
 -u_long lastseconds;
 -
 -/*
   * Convert from dos' idea of time to unix'. This will probably only be
   * called from the stat(), and fstat() system calls and so probably need
   * not be too efficient.
 @@ -184,11 +139,8 @@ u_long lastseconds;
  void
  dos2unixtime(u_int dd, u_int dt, u_int dh, int gmtoff, struct timespec *tsp)
  {
 -	u_long seconds;
 -	u_long m, month;
 -	u_long y, year;
 -	u_long days;
 -	const u_short *months;
 +	time_t seconds;
 +	struct clock_ymdhms ymd;

  	if (dd == 0) {
  		/*
 @@ -198,37 +150,15 @@ dos2unixtime(u_int dd, u_int dt, u_int d
  		tsp->tv_nsec = 0;
  		return;
  	}
 -	seconds = ((dt & DT_2SECONDS_MASK) >> DT_2SECONDS_SHIFT) * 2
 -	    + ((dt & DT_MINUTES_MASK) >> DT_MINUTES_SHIFT) * 60
 -	    + ((dt & DT_HOURS_MASK) >> DT_HOURS_SHIFT) * 3600
 -	    + dh / 100;
 -	/*
 -	 * If the year, month, and day from the last conversion are the
 -	 * same then use the saved value.
 -	 */
 -	if (lastdosdate != dd) {
 -		lastdosdate = dd;
 -		days = 0;
 -		year = (dd & DD_YEAR_MASK) >> DD_YEAR_SHIFT;
 -		for (y = 0; y < year; y++)
 -			days += y & 0x03 ? 365 : 366;
 -		months = year & 0x03 ? regyear : leapyear;
 -		/*
 -		 * Prevent going from 0 to 0xffffffff in the following
 -		 * loop.
 -		 */
 -		month = (dd & DD_MONTH_MASK) >> DD_MONTH_SHIFT;
 -		if (month == 0) {
 -			printf("%s: month value out of range (%ld)\n",
 -			    __func__, month);
 -			month = 1;
 -		}
 -		for (m = 0; m < month - 1; m++)
 -			days += months[m];
 -		days += ((dd & DD_DAY_MASK) >> DD_DAY_SHIFT) - 1;
 -		lastseconds = (days * 24 * 60 * 60) + SECONDSTO1980;
 -	}
 -	tsp->tv_sec = seconds + lastseconds;
 +
 +	memset(&ymd, 0, sizeof(ymd));
 +	ymd.dt_year = ((dd & DD_YEAR_MASK) >> DD_YEAR_SHIFT) + 1980 ;
 +	ymd.dt_mon = ((dd & DD_MONTH_MASK) >> DD_MONTH_SHIFT);
 +	ymd.dt_day = ((dd & DD_DAY_MASK) >> DD_DAY_SHIFT);
 +
 +	seconds = clock_ymdhms_to_secs(&ymd);
 +
 +	tsp->tv_sec = seconds;
  	tsp->tv_sec -= gmtoff;	/* time zone correction */
  	tsp->tv_nsec = (dh % 100) * 10000000;
  }

From: christos@zoulas.com (Christos Zoulas)
To: gnats-bugs@NetBSD.org, gnats-admin@netbsd.org, netbsd-bugs@netbsd.org, 
	gson@gson.org (Andreas Gustafsson)
Cc: 
Subject: Re: PR/49144 CVS commit: src/tests/fs/vfs
Date: Sat, 30 Aug 2014 11:51:01 -0400

 On Aug 30,  3:35pm, martin@duskware.de (Martin Husemann) wrote:
 -- Subject: Re: PR/49144 CVS commit: src/tests/fs/vfs

 |  Suggestions how to best "toolify" sys/dev/clock_subr.c ?

 it just needs a couple ifdef _KERNEL.

 christos

From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@NetBSD.org
Cc: gnats-admin@netbsd.org, netbsd-bugs@netbsd.org,
	Andreas Gustafsson <gson@gson.org>
Subject: Re: PR/49144 CVS commit: src/tests/fs/vfs
Date: Sat, 30 Aug 2014 21:23:14 +0200

 On Sat, Aug 30, 2014 at 03:55:00PM +0000, Christos Zoulas wrote:
 >  it just needs a couple ifdef _KERNEL.

 And moving to somewhere in src/common, I suppose.

 Martin

From: christos@zoulas.com (Christos Zoulas)
To: Martin Husemann <martin@duskware.de>, gnats-bugs@NetBSD.org
Cc: gnats-admin@netbsd.org, netbsd-bugs@netbsd.org, 
	Andreas Gustafsson <gson@gson.org>
Subject: Re: PR/49144 CVS commit: src/tests/fs/vfs
Date: Sat, 30 Aug 2014 15:36:34 -0400

 On Aug 30,  9:23pm, martin@duskware.de (Martin Husemann) wrote:
 -- Subject: Re: PR/49144 CVS commit: src/tests/fs/vfs

 | And moving to somewhere in src/common, I suppose.

 Leave it there for now and .PATH it in.

 christos

From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@NetBSD.org
Cc: gnats-admin@netbsd.org, netbsd-bugs@netbsd.org,
	Andreas Gustafsson <gson@gson.org>
Subject: Re: PR/49144 CVS commit: src/tests/fs/vfs
Date: Sun, 31 Aug 2014 10:15:40 +0200

 Yes, userland compilation is easy, but tool compilation means reverting
 revision 1.5 of src/usr.sbin/makefs/msdos/Makefile.inc:

 revision 1.5
 date: 2013-01-26 17:50:46 +0100;  author: christos;  state: Exp;  lines: +5 -2;
 branches:  1.5.4;  1.5.10;
 make this cross-compile friendly.


 Which I fail to understand - could you have a look, please?

 Martin

From: christos@zoulas.com (Christos Zoulas)
To: Martin Husemann <martin@duskware.de>, gnats-bugs@NetBSD.org
Cc: gnats-admin@netbsd.org, netbsd-bugs@netbsd.org, 
	Andreas Gustafsson <gson@gson.org>
Subject: Re: PR/49144 CVS commit: src/tests/fs/vfs
Date: Sun, 31 Aug 2014 05:46:18 -0400

 On Aug 31, 10:15am, martin@duskware.de (Martin Husemann) wrote:
 -- Subject: Re: PR/49144 CVS commit: src/tests/fs/vfs

 | Yes, userland compilation is easy, but tool compilation means reverting
 | revision 1.5 of src/usr.sbin/makefs/msdos/Makefile.inc:
 | 
 | revision 1.5
 | date: 2013-01-26 17:50:46 +0100;  author: christos;  state: Exp;  lines: +5 -2;
 | branches:  1.5.4;  1.5.10;
 | make this cross-compile friendly.
 | 
 | 
 | Which I fail to understand - could you have a look, please?

 Hmm, yes. I forgot about the tool part of this. We either need to make
 the clock_dev stuff part of common, or copy dev/clock_dev.h in tools/compat
 like we did for everything else.

 christos

From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/49144 CVS commit: src/sys/dev
Date: Sat, 6 Sep 2014 18:04:28 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Sat Sep  6 18:04:28 UTC 2014

 Modified Files:
 	src/sys/dev: clock_subr.c

 Log Message:
 Counting leap years was fine while we had 32bit time_t - but now it
 is not a good idea for dates far away in the future.
 For dates in the year 2000 or later, use arithmetic instead (since the
 repeating periods are well aligned). Should fix PR 49144.


 To generate a diff of this commit:
 cvs rdiff -u -r1.20 -r1.21 src/sys/dev/clock_subr.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@NetBSD.org
Cc: Andreas Gustafsson <gson@gson.org>
Subject: Re: PR/49144 CVS commit: src/sys/dev
Date: Sat, 6 Sep 2014 20:16:30 +0200

 On Sat, Sep 06, 2014 at 06:05:00PM +0000, Martin Husemann wrote:
 > Should fix PR 49144.

 Alas, it doesn't seem to fix it :-(

From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/49144 CVS commit: src
Date: Sun, 7 Sep 2014 11:50:23 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Sun Sep  7 11:50:23 UTC 2014

 Modified Files:
 	src/sys/dev: clock_subr.c clock_subr.h
 	src/tools/compat/dev: clock_subr.h

 Log Message:
 Avoid overflowing the "year" value by making the field uint64_t. Adapt
 arguments and local variables accordingly.
 This now fixes PR 49144 for real.


 To generate a diff of this commit:
 cvs rdiff -u -r1.21 -r1.22 src/sys/dev/clock_subr.c src/sys/dev/clock_subr.h
 cvs rdiff -u -r1.1 -r1.2 src/tools/compat/dev/clock_subr.h

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-By: gson@NetBSD.org
State-Changed-When: Tue, 09 Sep 2014 10:48:35 +0000
State-Changed-Why:
Martin fixed it.


From: "Soren Jacobsen" <snj@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/49144 CVS commit: [netbsd-7] src
Date: Wed, 12 Nov 2014 18:50:56 +0000

 Module Name:	src
 Committed By:	snj
 Date:		Wed Nov 12 18:50:56 UTC 2014

 Modified Files:
 	src/share/man/man9 [netbsd-7]: todr.9
 	src/sys/arch/sh3/dev [netbsd-7]: rtc.c
 	src/sys/dev [netbsd-7]: clock_subr.c clock_subr.h
 	src/sys/fs/msdosfs [netbsd-7]: msdosfs_conv.c
 	src/tools/compat [netbsd-7]: compat_defs.h
 	src/usr.sbin/makefs/msdos [netbsd-7]: Makefile.inc
 Added Files:
 	src/tools/compat/dev [netbsd-7]: clock_subr.h

 Log Message:
 Pull up following revision(s) (requested by martin in ticket #216):
 	share/man/man9/todr.9: revision 1.17
 	sys/arch/sh3/dev/rtc.c: revision 1.9
 	sys/dev/clock_subr.c: revision 1.17-1.22
 	sys/dev/clock_subr.h: revision 1.22
 	sys/fs/msdosfs/msdosfs_conv.c: revision 1.10
 	tools/compat/compat_defs.h: revision 1.98
 	tools/compat/dev/clock_subr.h: revision 1.1-1.2
 	usr.sbin/makefs/msdos/Makefile.inc: revision 1.6
 clock_secs_to_ymdhms(9) takes seconds as a time_t, not int.
 --
 Make this compile- and usable from userland as well.
 --
 Add a slightly stripped down version of sys/dev/clock/clock_subr.h to make
 this code available for tools.
 --
 Reformulate an overflow test so it can be used in tool builds (i.e. does
 not depend on netbsd specific macros).
 --
 Make msdosfs time conversion use the y/m/d/h/m/s conversion functions
 from clock_subr.c and compile that into the userland (and tools)
 makefs as well.
 --
 Copy definitions of __type_min(t), __type_max(t), and some related macros,
 from <sys/cdefs.h>, for use when building tools.
 --
 Revert previous; test secs > __type_max(time_t) again, now
 that __type_max is available in tools/compat/compat_defs.h.
 --
 If HAVE_NBTOOL_CONFIG_H is set, then include "nbtool_config.h",
 because this file is compiled as part of tools/makefs.
 --
 Counting leap years was fine while we had 32bit time_t - but now it
 is not a good idea for dates far away in the future.
 For dates in the year 2000 or later, use arithmetic instead (since the
 repeating periods are well aligned). Should fix PR 49144.
 --
 Avoid overflowing the "year" value by making the field uint64_t. Adapt
 arguments and local variables accordingly.
 This now fixes PR 49144 for real.
 --
 Adapt formats for debug printfs to clock_subr type changes.


 To generate a diff of this commit:
 cvs rdiff -u -r1.16 -r1.16.26.1 src/share/man/man9/todr.9
 cvs rdiff -u -r1.8 -r1.8.34.1 src/sys/arch/sh3/dev/rtc.c
 cvs rdiff -u -r1.16 -r1.16.30.1 src/sys/dev/clock_subr.c
 cvs rdiff -u -r1.21 -r1.21.38.1 src/sys/dev/clock_subr.h
 cvs rdiff -u -r1.9 -r1.9.12.1 src/sys/fs/msdosfs/msdosfs_conv.c
 cvs rdiff -u -r1.97 -r1.97.2.1 src/tools/compat/compat_defs.h
 cvs rdiff -u -r0 -r1.2.2.2 src/tools/compat/dev/clock_subr.h
 cvs rdiff -u -r1.5 -r1.5.12.1 src/usr.sbin/makefs/msdos/Makefile.inc

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.