Re: uh oh: when to use the xprintf module

2007-11-05 Thread Daniel Jacobowitz
On Sat, Nov 03, 2007 at 12:23:16AM +0100, Jim Meyering wrote: > This is not totally fair, because while I made mmap64 return -1, > I did not set errno, which would normally happen for a real failure. > I tried, but __errno_location() returns an invalid address. FYI, try ((int * (*) ()) __errno_loc

Re: uh oh: when to use the xprintf module

2007-11-02 Thread Bruno Haible
Jim Meyering wrote: > Unfortunately, you may well have to use xprintf much more generally, > (or else check all *printf return values) if you care about robustness > under low-memory conditions. Yes, it's not only FreeBSD 5 and NetBSD 3 which are affected by this problem, but also FreeBSD 6, MacOS

uh oh: when to use the xprintf module

2007-11-02 Thread Jim Meyering
Unfortunately, you may well have to use xprintf much more generally, (or else check all *printf return values) if you care about robustness under low-memory conditions. This is because the printf, fputs, fwrite, etc. functions (at least glibc-based functions) always allocate memory upon stream ini