lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090727224432.GB7142@elf.ucw.cz>
Date:	Tue, 28 Jul 2009 00:44:32 +0200
From:	Pavel Machek <pavel@....cz>
To:	OGAWA Hirofumi <hirofumi@...l.parknet.co.jp>
Cc:	Zhaolei <zhaolei@...fujitsu.com>,
	Andrew Morton <akpm@...ux-foundation.org>, mingo@...e.hu,
	tglx@...utronix.de, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 1/2] Add function to convert between calendar time
	and broken-down time for universal use

On Sat 2009-07-25 14:42:06, OGAWA Hirofumi wrote:
> Zhaolei <zhaolei@...fujitsu.com> writes:
> 
> > +/*
> > + * Similar to the struct tm in userspace <time.h>, but it needs to be here so
> > + * that the kernel source is self contained.
> > + */
> > +struct tm {
> > +	/*
> > +	 * the number of seconds after the minute, normally in the range
> > +	 * 0 to 59, but can be up to 60 to allow for leap seconds
> > +	 */
> > +	int tm_sec;
> > +	/* the number of minutes after the hour, in the range 0 to 59*/
> > +	int tm_min;
> > +	/* the number of hours past midnight, in the range 0 to 23 */
> > +	int tm_hour;
> > +	/* the day of the month, in the range 1 to 31 */
> > +	int tm_mday;
> > +	/* the number of months since January, in the range 0 to 11 */
> > +	int tm_mon;
> > +	/* the number of years since 1900 */
> > +	int tm_year;
> 
> Why isn't this "long"? "int" can overflow.

Overflow? Year?

I'm not sure how far ahead you are looking, but support for year
2000000000 (2e9) seems perfectly okay to me. (Our friendly star here,
sun, is going to die at cca year 5e9, for comparison. )

									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ