| Author |
Message |
|
| rich.neswold at gmail.com |
Posted: Wed Jun 15, 2005 12:31 pm |
|
|
|
Guest
|
Hello,
I'm running R10B-5 on my NetBSD 2.0.2 system. I noticed that
erlang:localtime() was returning UTC time. It turns out that
'configure' detects localtime_r() on my system and uses it. However,
on NetBSD, the man page says:
"localtime_r() does not imply initialization of the local time conversion
information; the application may need to do so by calling tzset(3)."
Looking through the BEAM source, I couldn't find any reference to
tzset(3) so I added it to the emulator initialization. The man page
didn't seem to imply that each thread needed to call it, so I didn't
try to put tzset() in the process initialization code.
I rebuilt my OTP installation using the following patch, and now the
localtime functions work:
--- erts/emulator/sys/unix/sys.c.orig 2005-06-14 23:25:38.000000000 -0500
+++ erts/emulator/sys/unix/sys.c 2005-06-14 23:28:11.000000000 -0500
_at__at_ -33,6 +33,10 _at__at_
#include <ctype.h>
#include <sys/utsname.h>
+#ifdef HAVE_LOCALTIME_R
+#include <time.h>
+#endif
+
#if !defined(USE_SELECT)
# ifdef HAVE_POLL_H
_at__at_ -428,6 +432,9 _at__at_
if (isatty(0)) {
tcgetattr(0,&initial_tty_mode);
}
+#ifdef HAVE_LOCALTIME_R
+ tzset();
+#endif
}
--
Rich
AIM : rnezzy
ICQ : 174908475
Post generated using Mail2Forum (http://m2f.sourceforge.net) |
|
|
| Back to top |
|
| rich.neswold at gmail.com |
Posted: Thu Jun 16, 2005 4:15 pm |
|
|
|
Guest
|
On 6/15/05, Rich Neswold <rich.neswold_at_gmail.com> wrote:
> I rebuilt my OTP installation using the following patch, and now the
> localtime functions work:
Sorry for the extra traffic, but I wasn't subscribed to the -patches
mailing list (I am now.) I missed the replies (if any) to my patch and
there doesn't appear to be an archive for -patches.
If there was an response, could the author please resend it to me
directly? I'll then be caught up and subscribed. Thanks!
--
Rich
AIM : rnezzy
ICQ : 174908475
Post generated using Mail2Forum (http://m2f.sourceforge.net) |
|
|
| Back to top |
|
| raimo at erix.ericsson.se |
Posted: Fri Jun 17, 2005 7:49 am |
|
|
|
Guest
|
Sorry, there was no response, but here it comes!
We did not manage to get it into R10B-6 about to be released, but
it will be in the next release. We have to make some modifications
and test thoroughly that it does not break anything on any of our
commercial platforms.
--
/ Raimo Niskanen, Erlang/OTP, Ericsson AB
Post generated using Mail2Forum (http://m2f.sourceforge.net) |
|
|
| Back to top |
|
| daniel.neri at gmail.com |
Posted: Fri Jun 17, 2005 8:38 am |
|
|
|
Guest
|
|
| Back to top |
|
| rich.neswold at gmail.com |
Posted: Fri Jun 17, 2005 2:25 pm |
|
|
|
Guest
|
|
| Back to top |
|
| rich.neswold at gmail.com |
Posted: Fri Jun 17, 2005 2:29 pm |
|
|
|
Guest
|
On 17 Jun 2005 09:25:20 +0200, Raimo Niskanen <raimo_at_erix.ericsson.se> wrote:
> We did not manage to get it into R10B-6 about to be released, but
> it will be in the next release. We have to make some modifications
> and test thoroughly that it does not break anything on any of our
> commercial platforms.
Sounds good! Thanks!
--
Rich
AIM : rnezzy
ICQ : 174908475
Post generated using Mail2Forum (http://m2f.sourceforge.net) |
|
|
| Back to top |
|
|
|