<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>We have:<br><br> WITH errno = GetError() DO<br> IF errno = EINVAL THEN<br> (* hack to try to get real errno, hidden due to NBIO bug in connect *)<br> RefetchError (t.fd);<br> ELSIF errno = EBADF THEN<br> (* we'll try the same for EBADF, which we've seen on Alpha *)<br> RefetchError (t.fd);<br> END;<br> END;<br><br><br>PROCEDURE RefetchError(fd: INTEGER) =<br>(* Awful hack to retrieve a meaningful error from a TCP accept<br> socket. Only works on Ultrix and OSF. Leaves result<br> in GetError(). *)<br> VAR optbuf: int := 0; optlen: socklen_t := BYTESIZE(optbuf);<br> BEGIN<br> IF SocketPosix_IsUltrixOrOSF.Value THEN<br> EVAL getsockopt (fd, IPPROTO_TCP, TCP_NODELAY,<br> ADR(optbuf), ADR(optlen));<br> END;<br> END RefetchError;<br><br><br>does anyone know or believe this is useful code?<br>Does anyone object to removing it?<br>I don't believe we'll ever run on Ultrix.<br>OSF/Tru64 is of very marginal interest.<br>Posix doesn't bless this code.<br>It seems ok without this -- it is a subtle matter of precisely which error is raised.<br>Portable code can't depend on the supposedly better Ultrix/OSF behavior, unless they are substandard and return EINVAL/EBADF when other systems return something more specific.<br>If I could find this workaround in any half way recently maintained C or C++ (Perl? Python?) I'd feel a lot better. I guess I'll look.<br><br><br><br>More generally I'd like to see the essentially 4 socket libraries we have (libm3/posix, libm3/win32, m3-comm/win32, m3-comm/posix) merged into one portable C file, and support IPv6...<br><br><br> - Jay<br><br><br> </div></body>
</html>