Live data from Hacker News

Going long long on time_t

openbsd.org

21–30 of 92 posts

Re: Going long long on time_t

#21
post #10

So, this slide confused/troubled me: http://www.openbsd.org/papers/eurobsdcon_2013_time_t/mgp0002... I don't see why it would be a good idea to convert "time_t" to "long long". Having an alias specifically for time_t is part of what makes this kind of work doable. I could see maybe introducing another alias like "time64_t" or something, but once you convert it to "long long" the type is no longer tagged in a way that…

Introducing a new format specifier for every typedef will quickly exhaust the alphabet.

In 292 billion years when we overflow a 'long long' time_t humanity is really going to regret that flippant attitude.

Re: Going long long on time_t

#24
post #3

Earlier quoted context omitted.

My god, I'm not a fan of reading slides in general but this... this is a new dimension of horror. I can't shake the feeling that there's some sick humour in this.

What's so horrible about it? Obviously, it isn't on the same level as any of the slide decks web designers put up that are in a sane format (HTML5+js / PDF) which don't require you to actually click through, but then a) Theo De Raadt works much further down the stack b) This is probably something put up by the EuroBSDCon folks after converting his slides (can someone who was at the Con weigh in on this? If he actuall…

Not having any way to navigate without actually clicking the tiny "next" link is infuriating. I can't actually focus on the subject matter if I have to do that.

Re: Going long long on time_t

#25

Any idea why they would use long long rather than int64_t?

Imagine you just called time(2) and got a time_t value. Something like:

    time_t asdf = time();
And now you want to use printf to print that value to the screen. You can cast to 'long long', which is guaranteed to be at at least 64 bits wide, and ensure no loss of precision occurs:

    printf("%lld", (long long)asdf);
That will work whether time_t is 32 bit or 64 bit.

Re: Going long long on time_t

#28
post #3

If anyone has trouble reading this, there's also plain text versions of individual slides: http://www.openbsd.org/papers/eurobsdcon_2013_time_t/mgp0000... http://www.openbsd.org/papers/eurobsdcon_2013_time_t/mgp0000... etc. Here's the whole thing in one page, minus images: https://gist.github.com/anonymous/6757266/raw/3469464cb802e7...

My god, I'm not a fan of reading slides in general but this... this is a new dimension of horror. I can't shake the feeling that there's some sick humour in this.

No humor at all, it is real and frankly, I am worried for my children. http://y2038.com/

Re: Going long long on time_t

#29
post #3

Earlier quoted context omitted.

My god, I'm not a fan of reading slides in general but this... this is a new dimension of horror. I can't shake the feeling that there's some sick humour in this.

What's so horrible about it? Obviously, it isn't on the same level as any of the slide decks web designers put up that are in a sane format (HTML5+js / PDF) which don't require you to actually click through, but then a) Theo De Raadt works much further down the stack b) This is probably something put up by the EuroBSDCon folks after converting his slides (can someone who was at the Con weigh in on this? If he actuall…

It's 2013 and there are tons of programs that can generate a decent HTML based presentation from a text file. Heck, I've encountered one just today while looking at the slides for "fedmsg - The Fedora Infrastructure Message Bus" [1]; the tool is named hovercraft [2]. Another nice tool is landslide [3].

[1]: http://threebean.org/presentations/fedmsg-flock13/

[2]: http://hovercraft.readthedocs.org/

[3]: https://github.com/adamzap/landslide

Re: Going long long on time_t

#30
post #13

Earlier quoted context omitted.

int64_t is a userspace libc typedef. long long is ICO C (C99) and guaranteed to be 64 bits or more.

is userspace. It's at least theoretically possible for long long to be more than 64 bits. Why use long long (potentially, say, 128 bits) rather than int64_t for time_t? And why wouldn't int64_t be available in kernel space?

long long can be printed in printf with the "%lld" flag.
Post reply on HN