<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Darwin no longer uses wrapper functions for pread etc.<div><div apple-content-edited="true"><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div><br></div><div>I figured a static switch at build time.</div></span></span></span></span></span></span></span></span></div></span> </div><br><div><div>On 4 Jan 2009, at 19:35, Jay wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><div class="hmmessage" style="font-size: 10pt; font-family: Verdana; ">Exactly how?<br>Like off_t == word?<br>That isn't right.<br> <br>Switch which files?<br>I want to reduce switching more than what is needed.<br>Can the string in an extern be "forwarded"?<br>That would be the ideal granularity here.<br>Darwin does stuff very similar or maybe the same as I am doing -- wrapper functions in C for reasons related to off_t, though the wrappers are a bit dubious, e.g.:<br> <br>int m3_pread(int d, void *buf, size_t nbytes, int offset)<br>{<br>  off_t off = (off_t)offset;<br>  return pread(d, buf, nbytes, offset);<br>}<br> <br>int m3_profil(char *samples, size_t size, u_long offset, u_int scale)<br>{<br>  off_t off = (off_t)offset;<br>  return profil(samples, size, offset, scale);<br>}<br> <br>int m3_pwrite(int d, const void *buf, size_t nbytes, int offset)<br>{<br>  off_t off = (off_t)offset;<br>  return pwrite(d, buf, nbytes, offset);<br>}<br> <br>int m3_ftruncate(int fd, int length)<br>{<br>  off_t len = (off_t) length;<br>  return ftruncate(fd, length);<br>}<br><br>What does the first line of each of those accomplish?<br> <br>void<br>m3_assignOffT (off_t* dest, long src)<br>{<br>  *dest = (off_t)src;<br>}<br><br>Is that widening or narrowing, and if it is narrowing, silent truncation?<br>Granted, Modula-3 doesn't check for integer overflow anyway, so silent truncation I guess is "ok".<br> <br>Ideally, every system would have a 64 bit off_t, if not the default, at least via #defines, or using function names with "64" appended (or both). The case for 32bit off_t would be interop with existing code. Otherwise, it seems clear that it should always, if possible, be 64 bits. time_t should be 64 bits too, but that's another matter.<br> <br>I did just check and DJGPP seems limited to 32bit off_t.<br>So eventually it might have to go back to Usysdep.i3, but ok.<br> <br> - Jay<br><br><br><hr id="stopSpelling"><br>From:<span class="Apple-converted-space"> </span><a href="mailto:hosking@cs.purdue.edu">hosking@cs.purdue.edu</a><br>To:<span class="Apple-converted-space"> </span><a href="mailto:jay.krell@cornell.edu">jay.krell@cornell.edu</a><br>Date: Sun, 4 Jan 2009 15:54:48 +1100<br>CC:<span class="Apple-converted-space"> </span><a href="mailto:m3commit@elegosoft.com">m3commit@elegosoft.com</a><br>Subject: Re: [M3commit] CVS Update: cm3<br><br>Why not just switch between 32-bit and 64-bit versions.<br><div><br><div><span class="EC_Apple-style-span" style="word-spacing: 0px; font: normal normal normal 12px/normal Helvetica; text-transform: none; color: rgb(0, 0, 0); text-indent: 0px; white-space: normal; letter-spacing: normal; border-collapse: separate; "><div style="word-wrap: break-word; "><span class="EC_Apple-style-span" style="word-spacing: 0px; font: normal normal normal 12px/normal Helvetica; text-transform: none; color: rgb(0, 0, 0); text-indent: 0px; white-space: normal; letter-spacing: normal; border-collapse: separate; "><span class="EC_Apple-style-span" style="word-spacing: 0px; font: normal normal normal 12px/normal Helvetica; text-transform: none; color: rgb(0, 0, 0); text-indent: 0px; white-space: normal; letter-spacing: normal; border-collapse: separate; "><span class="EC_Apple-style-span" style="word-spacing: 0px; font: normal normal normal 12px/normal Helvetica; text-transform: none; color: rgb(0, 0, 0); text-indent: 0px; white-space: normal; letter-spacing: normal; border-collapse: separate; "><span class="EC_Apple-style-span" style="word-spacing: 0px; font: normal normal normal 12px/normal Helvetica; text-transform: none; color: rgb(0, 0, 0); text-indent: 0px; white-space: normal; letter-spacing: normal; border-collapse: separate; "><span class="EC_Apple-style-span" style="word-spacing: 0px; font: normal normal normal 12px/normal Helvetica; text-transform: none; color: rgb(0, 0, 0); text-indent: 0px; white-space: normal; letter-spacing: normal; border-collapse: separate; "><span class="EC_Apple-style-span" style="word-spacing: 0px; font: normal normal normal 12px/normal Helvetica; text-transform: none; color: rgb(0, 0, 0); text-indent: 0px; white-space: normal; letter-spacing: normal; border-collapse: separate; "><span class="EC_Apple-style-span" style="word-spacing: 0px; font: normal normal normal 12px/normal Helvetica; text-transform: none; color: rgb(0, 0, 0); text-indent: 0px; white-space: normal; letter-spacing: normal; border-collapse: separate; "><span class="EC_Apple-style-span" style="word-spacing: 0px; font: normal normal normal 12px/normal Helvetica; text-transform: none; color: rgb(0, 0, 0); text-indent: 0px; white-space: normal; letter-spacing: normal; border-collapse: separate; "><div><font class="EC_Apple-style-span" color="#0000ff"><font class="EC_Apple-style-span" face="Gill Sans"><span class="EC_Apple-style-span" style="color: rgb(0, 0, 255); font-family: 'Gill Sans'; "><span class="EC_Apple-style-span" style="color: rgb(0, 0, 255); font-family: 'Gill Sans'; ">Antony Hosking</span></span></font></font><font class="EC_Apple-style-span" face="Gill Sans"><span class="EC_Apple-style-span" style="font-family: 'Gill Sans'; "><span class="EC_Apple-style-span" style="font-family: 'Gill Sans'; "><span class="Apple-converted-space"> </span>|<span class="Apple-converted-space"> </span></span></span><span class="EC_Apple-style-span" style="font-family: 'Gill Sans'; "><span class="EC_Apple-style-span" style="font-family: 'Gill Sans'; ">Associate Professor</span></span><span class="EC_Apple-style-span" style="font-family: 'Gill Sans'; "><span class="EC_Apple-style-span" style="font-family: 'Gill Sans'; "> | Computer Science | Purdue University</span></span></font></div><div><font class="EC_Apple-style-span" face="GillSans-Light"><span class="EC_Apple-style-span" style="font-family: GillSans-Light; ">305 N. University Street | West Lafayette | IN 47907 | USA</span></font></div><div><font class="EC_Apple-style-span" face="Gill Sans" color="#0000ff"><span class="EC_Apple-style-span" style="color: rgb(0, 0, 255); font-family: 'Gill Sans'; "><span class="EC_Apple-style-span" style="color: rgb(0, 0, 255); font-family: 'Gill Sans'; ">Office</span></span></font><font class="EC_Apple-style-span" face="GillSans-Light"><span class="EC_Apple-style-span" style="font-family: GillSans-Light; "><span class="EC_Apple-style-span" style="font-family: GillSans-Light; "> +1 765 494 6001 |<span class="Apple-converted-space"> </span></span></span></font><font class="EC_Apple-style-span" face="Gill Sans" color="#0000ff"><span class="EC_Apple-style-span" style="color: rgb(0, 0, 255); font-family: 'Gill Sans'; "><span class="EC_Apple-style-span" style="color: rgb(0, 0, 255); font-family: 'Gill Sans'; ">Mobile</span></span></font><font class="EC_Apple-style-span" face="GillSans-Light"><span class="EC_Apple-style-span" style="font-family: GillSans-Light; "><span class="EC_Apple-style-span" style="font-family: GillSans-Light; "><span class="Apple-converted-space"> </span>+1 765 427 5484</span></span></font></div><div><font class="EC_Apple-style-span" face="GillSans-Light"><br class="EC_khtml-block-placeholder"></font></div></span></span></span></span></span></span></span><br class="EC_Apple-interchange-newline"></span></div></span></div><br><div><div>On 4 Jan 2009, at 13:22, Jay wrote:</div><br class="EC_Apple-interchange-newline"><blockquote><span class="EC_Apple-style-span" style="word-spacing: 0px; font: normal normal normal 12px/normal Helvetica; text-transform: none; color: rgb(0, 0, 0); text-indent: 0px; white-space: normal; letter-spacing: normal; border-collapse: separate; "><div class="EC_hmmessage" style="font-size: 10pt; font-family: Verdana; "><div>But how about if we always #define _FILE_OFFSET_BITS 64 and use C wrappers?</div><div>  As I have done.</div><div>Or externs with "64" appended, but that prevents me from using one set of .i3 files.</div><div> </div><div>I mean, I know there are "modes" with 32 bit off_t, but we should really strive not to use them, if given a choice, eh?</div><div> </div><div>You think there are any systems we will ever care about that don't offer a 64 bit off_t (or off64_t, or whatever).</div><div> </div><div> - Jay<br><br><br><hr id="EC_stopSpelling">From: hosking@<br>To: jkrell@<br>Date: Sun, 4 Jan 2009 12:57:28 +1100<br>CC:<span class="EC_Apple-converted-space"> </span><a href="mailto:m3commit@elegosoft.com">m3commit@elegosoft.com</a><br>Subject: Re: [M3commit] CVS Update: cm3<br><br>On some platforms off_t is not 64 bits.  This from Solaris (see off_t==long):</div><div><br></div><div>#if defined(_LARGEFILE_SOURCE) || defined(_XPG5)</div><div>#ifndef _OFF_T</div><div>#define _OFF_T</div><div>#if defined(_LP64) || _FILE_OFFSET_BITS == 32</div><div>typedef long            off_t;</div><div>#else</div><div>typedef __longlong_t    off_t;</div><div>#endif</div><div>#ifdef  _LARGEFILE64_SOURCE</div><div>#ifdef _LP64</div><div>typedef off_t           off64_t;</div><div>#else</div><div>typedef __longlong_t    off64_t;</div><div>#endif</div><div>#endif /* _LARGEFILE64_SOURCE */</div><div>#endif /* _OFF_T */</div><div>#endif /* _LARGEFILE_SOURCE * </div><div><div><br class="EC_EC_webkit-block-placeholder"></div><div><br class="EC_EC_webkit-block-placeholder"></div><div><span class="EC_EC_Apple-style-span" style="word-spacing: 0px; font: normal normal normal 12px/normal Helvetica; text-transform: none; color: rgb(0, 0, 0); text-indent: 0px; white-space: normal; letter-spacing: normal; border-collapse: separate; "><div style="word-wrap: break-word; "><span class="EC_EC_Apple-style-span" style="word-spacing: 0px; font: normal normal normal 12px/normal Helvetica; text-transform: none; color: rgb(0, 0, 0); text-indent: 0px; white-space: normal; letter-spacing: normal; border-collapse: separate; "><span class="EC_EC_Apple-style-span" style="word-spacing: 0px; font: normal normal normal 12px/normal Helvetica; text-transform: none; color: rgb(0, 0, 0); text-indent: 0px; white-space: normal; letter-spacing: normal; border-collapse: separate; "><span class="EC_EC_Apple-style-span" style="word-spacing: 0px; font: normal normal normal 12px/normal Helvetica; text-transform: none; color: rgb(0, 0, 0); text-indent: 0px; white-space: normal; letter-spacing: normal; border-collapse: separate; "><span class="EC_EC_Apple-style-span" style="word-spacing: 0px; font: normal normal normal 12px/normal Helvetica; text-transform: none; color: rgb(0, 0, 0); text-indent: 0px; white-space: normal; letter-spacing: normal; border-collapse: separate; "><span class="EC_EC_Apple-style-span" style="word-spacing: 0px; font: normal normal normal 12px/normal Helvetica; text-transform: none; color: rgb(0, 0, 0); text-indent: 0px; white-space: normal; letter-spacing: normal; border-collapse: separate; "><span class="EC_EC_Apple-style-span" style="word-spacing: 0px; font: normal normal normal 12px/normal Helvetica; text-transform: none; color: rgb(0, 0, 0); text-indent: 0px; white-space: normal; letter-spacing: normal; border-collapse: separate; "><span class="EC_EC_Apple-style-span" style="word-spacing: 0px; font: normal normal normal 12px/normal Helvetica; text-transform: none; color: rgb(0, 0, 0); text-indent: 0px; white-space: normal; letter-spacing: normal; border-collapse: separate; "><span class="EC_EC_Apple-style-span" style="word-spacing: 0px; font: normal normal normal 12px/normal Helvetica; text-transform: none; color: rgb(0, 0, 0); text-indent: 0px; white-space: normal; letter-spacing: normal; border-collapse: separate; "><div><font class="EC_EC_Apple-style-span" color="#0000ff"><font class="EC_EC_Apple-style-span" face="Gill Sans"><span class="EC_EC_Apple-style-span" style="color: rgb(0, 0, 255); font-family: 'Gill Sans'; "><span class="EC_EC_Apple-style-span" style="color: rgb(0, 0, 255); font-family: 'Gill Sans'; ">Antony Hosking</span></span></font></font><font class="EC_EC_Apple-style-span" face="Gill Sans"><span class="EC_EC_Apple-style-span" style="font-family: 'Gill Sans'; "><span class="EC_EC_Apple-style-span" style="font-family: 'Gill Sans'; "><span class="EC_Apple-converted-space"> </span>|<span class="EC_Apple-converted-space"> </span></span></span><span class="EC_EC_Apple-style-span" style="font-family: 'Gill Sans'; "><span class="EC_EC_Apple-style-span" style="font-family: 'Gill Sans'; ">Associate Professor</span></span><span class="EC_EC_Apple-style-span" style="font-family: 'Gill Sans'; "><span class="EC_EC_Apple-style-span" style="font-family: 'Gill Sans'; "> | Computer Science | Purdue University</span></span></font></div><div><font class="EC_EC_Apple-style-span" face="GillSans-Light"><span class="EC_EC_Apple-style-span" style="font-family: GillSans-Light; ">305 N. University Street | West Lafayette | IN 47907 | USA</span></font></div><div><font class="EC_EC_Apple-style-span" face="Gill Sans" color="#0000ff"><span class="EC_EC_Apple-style-span" style="color: rgb(0, 0, 255); font-family: 'Gill Sans'; "><span class="EC_EC_Apple-style-span" style="color: rgb(0, 0, 255); font-family: 'Gill Sans'; ">Office</span></span></font><font class="EC_EC_Apple-style-span" face="GillSans-Light"><span class="EC_EC_Apple-style-span" style="font-family: GillSans-Light; "><span class="EC_EC_Apple-style-span" style="font-family: GillSans-Light; "> +1 765 494 6001 |<span class="EC_Apple-converted-space"> </span></span></span></font><font class="EC_EC_Apple-style-span" face="Gill Sans" color="#0000ff"><span class="EC_EC_Apple-style-span" style="color: rgb(0, 0, 255); font-family: 'Gill Sans'; "><span class="EC_EC_Apple-style-span" style="color: rgb(0, 0, 255); font-family: 'Gill Sans'; ">Mobile</span></span></font><font class="EC_EC_Apple-style-span" face="GillSans-Light"><span class="EC_EC_Apple-style-span" style="font-family: GillSans-Light; "><span class="EC_EC_Apple-style-span" style="font-family: GillSans-Light; "><span class="EC_Apple-converted-space"> </span>+1 765 427 5484</span></span></font></div><div><font class="EC_EC_Apple-style-span" face="GillSans-Light"><br class="EC_EC_khtml-block-placeholder"></font></div></span></span></span></span></span></span></span><br class="EC_EC_Apple-interchange-newline"></span></div></span></div><br><div><div>On 4 Jan 2009, at 01:53, Jay Krell wrote:</div><br class="EC_EC_Apple-interchange-newline"><blockquote><div>CVSROOT:<span class="EC_EC_Apple-tab-span" style="white-space: pre; "> </span>/usr/cvs<br>Changes by:<span class="EC_EC_Apple-tab-span" style="white-space: pre; "> </span>jkrell@birch.<span class="EC_EC_Apple-tab-span" style="white-space: pre; "> </span>09/01/04 01:53:03<br><br>Modified files:<br><span class="EC_EC_Apple-tab-span" style="white-space: pre; "></span>cm3/m3-libs/m3core/src/unix/Common/: Unix.i3 Utypes.i3<span class="EC_Apple-converted-space"> </span><br><span class="EC_EC_Apple-tab-span" style="white-space: pre; "></span>cm3/m3-libs/m3core/src/unix/cygwin/: Usysdep.i3<span class="EC_Apple-converted-space"> </span><br><span class="EC_EC_Apple-tab-span" style="white-space: pre; "></span>cm3/m3-libs/m3core/src/unix/linux-common/: Usysdep.i3<span class="EC_Apple-converted-space"> </span><br><span class="EC_EC_Apple-tab-span" style="white-space: pre; "></span>cm3/m3-libs/m3core/src/unix/openbsd-common/: Usysdep.i3<span class="EC_Apple-converted-space"> </span><br><br>Log message:<br><span class="EC_EC_Apple-tab-span" style="white-space: pre; "></span>significant reduction in sysdep content<br><span class="EC_EC_Apple-tab-span" style="white-space: pre; "></span><br><span class="EC_EC_Apple-tab-span" style="white-space: pre; "></span>off_t is always 64 bits (or at least let's hope so)<br><span class="EC_EC_Apple-tab-span" style="white-space: pre; "></span>the dir/stat flags are mostly all the same,<br><span class="EC_EC_Apple-tab-span" style="white-space: pre; "></span>except for a few that are zero on cygwin<br><span class="EC_EC_Apple-tab-span" style="white-space: pre; "></span><br><span class="EC_EC_Apple-tab-span" style="white-space: pre; "></span>M[RWX][OWNER GROUP OTHER]<br><span class="EC_EC_Apple-tab-span" style="white-space: pre; "></span>[FXWR]_OK<br><span class="EC_EC_Apple-tab-span" style="white-space: pre; "></span>F_SETFD, F_GETFL, F_SETFL<br><span class="EC_EC_Apple-tab-span" style="white-space: pre; "></span>FIONREAD<br><span class="EC_EC_Apple-tab-span" style="white-space: pre; "></span>ITIMER_REAL<br><span class="EC_EC_Apple-tab-span" style="white-space: pre; "></span>ITIMER_VIRTUAL<br><span class="EC_EC_Apple-tab-span" style="white-space: pre; "></span><br><span class="EC_EC_Apple-tab-span" style="white-space: pre; "></span>Some of this might be by chance and not by-standard,<br><span class="EC_EC_Apple-tab-span" style="white-space: pre; "></span>so under review for new platforms, and probably should be verified<br><span class="EC_EC_Apple-tab-span" style="white-space: pre; "></span>during native builds.<br><span class="EC_EC_Apple-tab-span" style="white-space: pre; "></span><br><span class="EC_EC_Apple-tab-span" style="white-space: pre; "></span>note that OS/2 has a different S_IFMT but not quite relevant here<br></div></blockquote></div><br></div></div></span><br class="EC_Apple-interchange-newline"></blockquote></div><br></div></div></span><br class="Apple-interchange-newline"></blockquote></div><br></div></body></html>