[Vm-dev] squeak on opensolaris 2009.06

John M McIntosh johnmci at smalltalkconsulting.com
Mon Nov 9 15:16:30 UTC 2009


Something like

do {
result = some_system_call(...);
} while (result <  0 &&  errno == EINTR);
...

for the recv, select, close, recvfrom, read, write
and likely I've missed some and also haven't considered the ipv6 calls.

So for example the

static int socketReadable(int s)
{
   char buf[1];
   int n= recv(s, (void *)buf, 1, MSG_PEEK);
   if (n > 0) return 1;
   if ((n < 0) && (errno == EWOULDBLOCK)) return 0;
   return -1;	/* EOF */
}

would become

static int socketReadable(int s)
{
   char buf[1];

   int n;
   do  {	
      n = recv(s, (void *)buf, 1, MSG_PEEK);
   } while (n <  0 &&  errno == EINTR);

   if (n > 0) return 1;
   if ((n < 0) && (errno == EWOULDBLOCK)) return 0;
   return -1;	/* EOF */
}

On 2009-11-09, at 6:10 AM, Randal L. Schwartz wrote:

>
>>>>>> "Bert" == Bert Freudenberg <bert at freudenbergs.de> writes:
>
>>>> sqConnectToPort: Interrupted system call.
>
> Bert> This very much sounds like it could be the issue. A couple  
> years back I
> Bert> was called in to make the Browser plugin work on Solaris. The  
> main issue
> Bert> turned out to be unhandled return codes. The dominance of  
> Linux makes us
> Bert> sloppy I guess ...
>
> Is it just a matter of looping when you see EINTR, or is there a  
> reason that
> should send you down some other path, handled at a higher level  
> (above the VM,
> for example)?
>
> I'm gonna try building a VM in the next couple of days, and I need to
> understand how to handle this.
>
> -- 
> Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503  
> 777 0095
> <merlyn at stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
> Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
> See http://methodsandmessages.vox.com/ for Smalltalk and Seaside  
> discussion

--
= 
= 
= 
========================================================================
John M. McIntosh <johnmci at smalltalkconsulting.com>   Twitter:   
squeaker68882
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
= 
= 
= 
========================================================================






More information about the Vm-dev mailing list