On Mon, Sep 10, 2007 at 09:25:26PM +0400, Dmitry Potapov wrote: [...] > > With dietlibc: > > > > $ ./t > > signal handler called, sig=2 > > writer: num_bytes=80008 num_lines=10001 > > writer: expected num_bytes=80000 but was 80008 > > reader: num_bytes=80007 num_lines=10000 > > reader: number of missing bytes: -7 > > > > And dietlibc behaves the same as glibc patched with your > > (Dmitry's) change upon the fflush. > > No, glibc with my patch gives: [...]
Sorry for the misunderstanding, I meant "upon the fflush", as in wrt the issue at stake, that is the fact that dietlibc doesn't seem to empty the output buffer upon an unsuccessful fflush either, which confirms what you suspected earlier through reading the dietlibc code. I did not mean that "t" was behaving the same in glibc and dietlibc. With the glibc, I obtain: $ ~/t signal handler called, sig=2 error at num_bytes=66560 fputs: Interrupted system call reader: num_bytes=80000 num_lines=10000 writer: num_bytes=80000 num_lines=10000 And with your fix reverted: .../glibc-2.6.1/build-tree/i386-libc$ LD_LIBRARY_PATH=$PWD ~/t signal handler called, sig=2 error at num_bytes=66560 fputs: Interrupted system call writer: num_bytes=80000 num_lines=10000 reader: num_bytes=78976 num_lines=9872 reader: number of missing bytes: 1024 as expected. Best regards, Stéphane