Hacker News new | ask | show | jobs
by jdamato 3403 days ago
Hi, both are answered in the article:

First:

> What’s going on here is that the first call to localtime in glibc opens and reads the contents of /etc/localtime. All subsequent calls to localtime internally call stat, but they do this to ensure that the timezone file has not changed.

and second: read the section titled "Preventing extraneous system calls" for the answer to your second question.

1 comments

Those "answers" are more about how than why.
Thanks for reading and I'm glad to hear you loved my post!