I am encountering a problem similar to the one mentioned here,

http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&th=16d3eb9718c73a88&rnum=1
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&th=ec398d145e0e36c1&rnum=2

except that mine happens with the fwrite() call in io_write(). A script using
two threads occasionally sees an exception being raised when calling IO#puts.
The code in io.c looks like this:

    n = fwrite(RSTRING(str)->ptr, 1, RSTRING(str)->len, f);
    if (n != RSTRING(str)->len && ferror(f)) {
        rb_sys_fail(fptr->path);
    }

How do I fix this? I don't suppose it's possible to wrap the fwrite() call
with TRAP_BEG/ TRAP_END, and if ferror(f) and errno == EINTR or ERESTART, just
ignore the result and skip raising the exception? What do I return from
io_write() in this case?

Fwiw, this is with ruby 1.7.3 (2002-09-03) [sparc-solaris2.8].

Thanks,
-- 
Jos Backus                       _/  _/_/_/      Sunnyvale, CA
                                _/  _/   _/
                               _/  _/_/_/
                          _/  _/  _/    _/
jos at catnook.com        _/_/   _/_/_/          require 'std/disclaimer'