<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
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: hosking@cs.purdue.edu<BR>To: jay.krell@cornell.edu<BR>Date: Sun, 4 Jan 2009 15:54:48 +1100<BR>CC: m3commit@elegosoft.com<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: 12px 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: 12px 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: 12px 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: 12px 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: 12px 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: 12px 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: 12px 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: 12px 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: 12px 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></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></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"> +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: 12px 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: 12px 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: 12px 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: 12px 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: 12px 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: 12px 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: 12px 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: 12px 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: 12px 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: 12px 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></body>
</html>