public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
[parent not found: <2HnMR-35F-55@gated-at.bofh.it>]
* year 9223372034708485227 problem
@ 2004-09-22 21:30 Pavel Machek
  2004-09-22 21:45 ` year 2038 problem on x86-64 Pavel Machek
  0 siblings, 1 reply; 4+ messages in thread
From: Pavel Machek @ 2004-09-22 21:30 UTC (permalink / raw)
  To: kernel list

Hi!

For testing (read() and write() is returning wrong value on 2.4
kernels) I played a bit with really big numbers... And I found out we
have year 9223372034708485227 problem ;-).

hobit:/tmp # cat 2gbtime.c

/**************************** 2gbwrite.c **************************/
#define _SVID_SOURCE /* glibc2 needs this */
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <values.h>
#include <malloc.h>
#include <string.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
#include <time.h>

int main(int argc, char **argv)
{
  long t = 0x7fffffff80123456;
  stime(&t);
  printf("It is now: %lx\n", time(NULL));
}
/*********************** end of 2gbwrite.c *************************/
hobit:/tmp # ./2gbtime
It is now: 7fffffff80123456
hobit:/tmp # date
Segmentation fault
hobit:/tmp # top
Segmentation fault
hobit:/tmp # mc
Segmentation fault
hobit:/tmp # /sbin//shutdown -r now
Segmentation fault
hobit:/tmp # halt
Segmentation fault
hobit:/tmp #

I'm not sure if it is kernel problem... but it is sure pretty
common. I wonder how much damage it will do to my filesystems: touch
foo seems to store the right year into reiserfs. I wonder if it is
still there after reboot? No, it is not. That looks like kernel bug :-).

Anyway I believe we are going to have some fun in year 2038. Even if
all systems are 64-bit by then, there will still be some 32-bit fields
hidden somewhere.

								Pavel
-- 
People were complaining that M$ turns users into beta-testers...
...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!

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

end of thread, other threads:[~2004-09-22 22:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <2Hn0k-2wz-9@gated-at.bofh.it>
     [not found] ` <2HnjK-2Ha-3@gated-at.bofh.it>
2004-09-22 22:27   ` year 2038 problem on x86-64 Andi Kleen
2004-09-22 22:34     ` Pavel Machek
     [not found] <2HnMR-35F-55@gated-at.bofh.it>
     [not found] ` <2HnMR-35F-57@gated-at.bofh.it>
     [not found]   ` <2HnMR-35F-53@gated-at.bofh.it>
     [not found]     ` <2HnWp-3b7-25@gated-at.bofh.it>
2004-09-22 22:51       ` Andi Kleen
2004-09-22 21:30 year 9223372034708485227 problem Pavel Machek
2004-09-22 21:45 ` year 2038 problem on x86-64 Pavel Machek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox