Hello,

On Fri, Nov 08, 2002 at 10:48:56AM +0900, nobu.nokada / softhome.net wrote:
> Perhaps, rb_io_fwrite()?

Agreed, that is a better name. The refactoring is definitely a good idea and
w_byten() is now properly protected.

> I'm not sure BROKEN_FWRITE is better or not.
 
I don't like it either. Hopefully Sun will fix this problem soon.  But in the
meantime something needs to be done :-/ On the bright side, my colleague tells
me that since installing the patched interpreter he has not seen any more data
corruption as a result of this problem, so the fix appears to work fine in my
case. Thread switch suspension remains a potential problem for others though.

So, should we perhaps add

    #if defined(sun)
    # define BROKEN_FWRITE 1
    #endif

to io.c for now? Or maybe we should add a configure option
(--with-broken-fwrite) and tell people to use this on Solaris?

[snip]
> +long
> +rb_io_fwrite(ptr, len, f)
> +    const char *ptr;
> +    long len;
> +    FILE *f;
> +{
> +    long n, r;
> +
> +    if ((n = len) <= 0) return n;
> +#if defined(__human68k__) || defined(sun)

Don't we want to use the code that calls safe_fwrite() when defined(sun)? Iow,
shouldn't this just be

    +#if defined(__human68k__)

?

Thanks again, Nobu.

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