<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
My plan here is roughly:<BR>
 <BR>
 <BR>
copy Utime.i3 to UtimeInternal.i3.<BR>
  Keeping only functions that traffic in struct_tm.<BR>
In Utime.i3 define a struct_tm that doesn't have tm_zone and tm_gmtoff.<BR>
UtimeInternal.i3 define a struct_tm that does include tm_zone and tm_gmtoff.<BR>
Provide UtimeInternal.i3 only on platforms that use DateBsd.m3.<BR>
 <BR>
 <BR>
Utime.i3 will therefore be portable.<BR>
 <BR>
 <BR>
Both of them will be implemented via copying wrappers though,<BR>
since the order of the fields, and the exact size of the struct, is not portable.<BR>
 <BR>
 <BR>
Probably as well only the *_r functions should be provided?<BR>
Not clear, since the non *_r functions have optional extra side affects such as setting tznzme.<BR>
Probably keep the non *_r functions but callers must know to (maybe) serialize them.<BR>
  As DatePosix.m3/DateBsd.m3 do.<BR>
I think most libc implementations use thread locals here, so the need to serialize is nearly zero.<BR>
However there are user threads and timezone/daylight/tzname to worry about, not sure<BR>
they are thread locals, or only the "direct result buffers".<BR>
 <BR>
This area is really a mess.<BR>
 <BR>
 - Jay<BR> <BR>
<HR id=stopSpelling>
From: jay.krell@cornell.edu<BR>To: m3devel@elegosoft.com<BR>Date: Sun, 20 Sep 2009 22:28:21 +0000<BR>Subject: [M3devel] time.h reentrancy?<BR><BR>
<STYLE>
.ExternalClass .ecxhmmessage P
{padding:0px;}
.ExternalClass body.ecxhmmessage
{font-size:10pt;font-family:Verdana;}
</STYLE>
Does anyone understand how the time.h *_r functions are supposed to behave wrt the char* tm_zone field in struct tm?<BR>This interface seems broken.<BR>Posix doesn't include the tm_zone field, so it is self-consistent.<BR> <BR>I think therefore even though DateBsd.m3 uses the _r functions, it should serialize.<BR> <BR> - Jay<BR><BR><BR><BR><BR><BR>                                     </body>
</html>