[freetds] siginterrupt

Christos Zoulas christos at zoulas.com
Mon Jan 28 10:49:37 EST 2008


On Jan 28,  8:53am, jklowden at freetds.org ("James K. Lowden") wrote:
-- Subject: Re: [freetds] siginterrupt

| ZIGLIO, Frediano, VF-IT wrote:
| > I finally found why signal handling can be so different from system to
| > system. The reason is RESTART flag. If this flag is set select do not
| > interrupt and return EINTR but just continue. 
| 
| My copy of Steven's UNP is at home.  I think that flag may not be
| standard?  

It is standard:

    http://www.opengroup.org/onlinepubs/009695399/functions/sigaction.html

It is best practice to assume that it is not set and handle the INTR in
a loop:

    http://www.opengroup.org/pubs/online/7908799/xsh/select.html

There are also issues in select that can cause it to fail if memory
or other resources are not available, so a lot of applications prefer
to use it with file descriptors set for non-blocking-io. This would
make the FreeTDS code a lot more complicated, for a dubious gain.
Most implementation support poll these days, and poll has a lot more
portable behavior.

christos



More information about the FreeTDS mailing list