PATCH: atomicio doesn't poll()

Benjamin Bennett ben at psc.edu
Sun Sep 16 08:33:26 EST 2007


atomicio contains the following in the read/write loop:

-----
                case -1:
#ifdef EWOULDBLOCK
                        if (errno == EINTR || errno == EWOULDBLOCK)
#else
                        if (errno == EINTR)
#endif
                                continue;
                        if (errno == EAGAIN) {
                                (void)poll(&pfd, 1, -1);
                                continue;
                        }
                        return 0;
-----


On systems where errno is set to EWOULDBLOCK we spin on the read or
write without polling.  On many other systems (Linux, Solaris, IRIX,
...) EWOULDBLOCK is defined as EAGAIN, and when errno is set to EAGAIN
we spin on the read or write without polling.

Please see patch.

thanks,

--ben
-------------- next part --------------
A non-text attachment was scrubbed...
Name: openssh-atomicio-polling.patch
Type: text/x-patch
Size: 1005 bytes
Desc: not available
Url : http://lists.mindrot.org/pipermail/openssh-unix-dev/attachments/20070915/65cc1662/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: OpenPGP digital signature
Url : http://lists.mindrot.org/pipermail/openssh-unix-dev/attachments/20070915/65cc1662/attachment-0001.bin 


More information about the openssh-unix-dev mailing list