9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] Some plan9 y2k problems
@ 1999-01-22  3:01 G.David
  0 siblings, 0 replies; 9+ messages in thread
From: G.David @ 1999-01-22  3:01 UTC (permalink / raw)


>to guard against systems on which (-1)%7 == 1?

[checking K&R, yup the sign of % with
negative arguments is machine dependent]

How about this?

xtime.wday = (day + 4) % 7;
if(day < 0) {
	if(xtime.wday > 0)
		xtime.wday *= -1;
	xtime.wday += 7;
}

The reason I care is 7340036 fits easily in a vlong...




^ permalink raw reply	[flat|nested] 9+ messages in thread

* [9fans] Some plan9 y2k problems
@ 1999-01-22  8:23 Andrew
  0 siblings, 0 replies; 9+ messages in thread
From: Andrew @ 1999-01-22  8:23 UTC (permalink / raw)



>
> I'm no bookmaker, but I'm tempted to take bets as to whether _any_
> aeroplane will in fact be in the air at midnight 1999/12/31.  My
> personal opinion is there won't, the airlines will be too shit-scared
> to risk it.


I've seen plenty of adverts and articles about a special Concorde flight.
I vaguely remember some German TV station giving away two tickets in a
competition.

The idea is that the participants celebrate the new year in Paris, fly
across the Atlantic and arrive in New York in time for a second
celebration. What a hoot it would be if Concorde never got off the runway
in Paris...

Andrew.




^ permalink raw reply	[flat|nested] 9+ messages in thread

* [9fans] Some plan9 y2k problems
@ 1999-01-22  4:42 Lucio
  0 siblings, 0 replies; 9+ messages in thread
From: Lucio @ 1999-01-22  4:42 UTC (permalink / raw)


According to Dennis Ritchie:
>
> Of course, it's also my own birthday.  But maybe I'll
> have died in an aircrash on 1/1/00, so don't plan too
> far ahead.
>
I'm no bookmaker, but I'm tempted to take bets as to whether _any_
aeroplane will in fact be in the air at midnight 1999/12/31.  My
personal opinion is there won't, the airlines will be too shit-scared
to risk it.

Imagine the chaos, though, getting all those flight schedules back into
operation on the next day.

Bottom line, Dennis, I trust we'll live to wish you a happy birthday on
Unix's billionth secondversary.

++L





^ permalink raw reply	[flat|nested] 9+ messages in thread

* [9fans] Some plan9 y2k problems
@ 1999-01-22  4:33 Dennis
  0 siblings, 0 replies; 9+ messages in thread
From: Dennis @ 1999-01-22  4:33 UTC (permalink / raw)


G. David Butler wrote:
>
> One more question, and sort of off topic --
>
> Does anyone know of any celebrations planned on Sep 8/9 2001
> for UNIX's 1,000,000,000 second anniversary?

Well, a couple of magazine reporters have asked me whether
999999999 seconds might be used as an EOF or sentinel or
other special value (I couldn't think of any such
applications, but what do I know)?

Of course, it's also my own birthday.  But maybe I'll
have died in an aircrash on 1/1/00, so don't plan too
far ahead.

	Dennis




^ permalink raw reply	[flat|nested] 9+ messages in thread

* [9fans] Some plan9 y2k problems
@ 1999-01-22  2:45 G.David
  0 siblings, 0 replies; 9+ messages in thread
From: G.David @ 1999-01-22  2:45 UTC (permalink / raw)


One more question, and sort of off topic --

Does anyone know of any celebrations planned on Sep 8/9 2001
for UNIX's 1,000,000,000 second anniversary?

:>




^ permalink raw reply	[flat|nested] 9+ messages in thread

* [9fans] Some plan9 y2k problems
@ 1999-01-22  1:05 G.David
  0 siblings, 0 replies; 9+ messages in thread
From: G.David @ 1999-01-22  1:05 UTC (permalink / raw)


This brings up another question, why is

xtime.wday = (day + 7340036L) % 7;

and not

xtime.wday = (day + 4) % 7;
if(xtime.wday < 0)
	xtime.wday += 7;




^ permalink raw reply	[flat|nested] 9+ messages in thread

* [9fans] Some plan9 y2k problems
@ 1999-01-13 14:55 presotto
  0 siblings, 0 replies; 9+ messages in thread
From: presotto @ 1999-01-13 14:55 UTC (permalink / raw)



Somewhere along the way we put it in libc, but when
I looked at the release version it was still everywhere.

------ forwarded message follows ------

>From cse.psu.edu!owner-9fans Wed Jan 13 01:09:14 EST 1999
Received: from plan9.bell-labs.com ([135.104.9.2]) by plan9; Wed Jan 13 01:09:14 EST 1999
Received: from cse.psu.edu ([130.203.3.50]) by plan9; Wed Jan 13 01:09:14 EST 1999
Received: from localhost (majordom@localhost)
	by cse.psu.edu (8.8.8/8.8.8) with SMTP id AAA24840;
	Wed, 13 Jan 1999 00:49:13 -0500 (EST)
Received: by claven.cse.psu.edu (bulk_mailer v1.5); Wed, 13 Jan 1999 00:48:58 -0500
Received: (from majordom@localhost)
	by cse.psu.edu (8.8.8/8.8.8) id AAA24802
	for 9fans-outgoing; Wed, 13 Jan 1999 00:48:50 -0500 (EST)
X-Authentication-Warning: claven.cse.psu.edu: majordom set sender to owner-9fans using -f
Received: from bio.cse.psu.edu (galapagos.cse.psu.edu [130.203.12.17])
	by cse.psu.edu (8.8.8/8.8.8) with SMTP id AAA24798
	for <9fans@cse.psu.edu>; Wed, 13 Jan 1999 00:48:47 -0500 (EST)
Received: (qmail 5800 invoked by uid 991); 13 Jan 1999 05:48:46 -0000
Message-ID: <19990113054846.5799.qmail@g.bio.cse.psu.edu>
Date: 13 Jan 1999 00:48:46 -0500
To: 9fans@cse.psu.edu
Subject: Re: [9fans] Some plan9 y2k problems
In-reply-to: Your message of "Tue, 12 Jan 1999 15:42:42 EST."
             <199901122043.PAA16347@cse.psu.edu>
Date: Wed, 13 Jan 1999 00:48:46 -0500
From: Scott Schwartz <schwartz@bio.cse.psu.edu>
Sender: owner-9fans@cse.psu.edu
Reply-To: 9fans@cse.psu.edu
Precedence: bulk

presotto@plan9.bell-labs.com writes:
| /sys/src/cmd/ftpfs/tm2sec.c:
| /sys/src/9/*/devrtc.c:
| ...
| There are probably other versions of this.

Good grief... isn't that what libraries are for?

"cutting and pasting considered harmful"





^ permalink raw reply	[flat|nested] 9+ messages in thread

* [9fans] Some plan9 y2k problems
@ 1999-01-13  5:48 Scott
  0 siblings, 0 replies; 9+ messages in thread
From: Scott @ 1999-01-13  5:48 UTC (permalink / raw)


presotto@plan9.bell-labs.com writes:
| /sys/src/cmd/ftpfs/tm2sec.c:
| /sys/src/9/*/devrtc.c:
| ...
| There are probably other versions of this.

Good grief... isn't that what libraries are for?

"cutting and pasting considered harmful"





^ permalink raw reply	[flat|nested] 9+ messages in thread

* [9fans] Some plan9 y2k problems
@ 1999-01-12 20:42 presotto
  0 siblings, 0 replies; 9+ messages in thread
From: presotto @ 1999-01-12 20:42 UTC (permalink / raw)


In case anyone cares...

They all involve screw ups in figuring out leap years.
The ctime.c one is stupidly calls dysize with the year
minus 1900 instead of the year.  Change it like the
following.

/sys/src/libc/9sys/ctime.c:

% diff /n/dump/1998/0513/sys/src/libc/9sys/ctime.c ctime.c
137c137
< 		for(d1 = 70; day >= dysize(d1); d1++)
---
> 		for(d1 = 1970; day >= dysize(d1); d1++)
140c140
< 		for (d1 = 70; day < 0; d1--)
---
> 		for (d1 = 1970; day < 0; d1--)
142c142
< 	xtime.year = d1;
---
> 	xtime.year = d1-1900;

/sys/src/cmd/ftpfs/tm2sec.c:
/sys/src/9/*/devrtc.c:

yrsize() computes the leap year incorrectly.  It should look like:

static int *
yrsize(int y)
{
	if((y%4) == 0 && ((y%100) != 0 || (y%400) == 0))
		return ldmsize;
	else
		return dmsize;
}

There are probably other versions of this.  I know I fixed it in
several places.  Good luck.




^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~1999-01-22  8:23 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-01-22  3:01 [9fans] Some plan9 y2k problems G.David
  -- strict thread matches above, loose matches on Subject: below --
1999-01-22  8:23 Andrew
1999-01-22  4:42 Lucio
1999-01-22  4:33 Dennis
1999-01-22  2:45 G.David
1999-01-22  1:05 G.David
1999-01-13 14:55 presotto
1999-01-13  5:48 Scott
1999-01-12 20:42 presotto

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).