bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why does close_stdout close stdout and stderr?


From: Assaf Gordon
Subject: Re: Why does close_stdout close stdout and stderr?
Date: Tue, 7 May 2019 03:49:22 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1

I should've added:

On 2019-05-07 3:44 a.m., Assaf Gordon wrote:
I'm attaching a sample test program to illustrate some points.
The program writes to stdout/stderr then optionally calls fclose/fflush/fsync.

Note the following:


The attached program also calls "ferror" on the stream,
but it does not signal an error in those listed cases.


Also note that the output of the program is purposefully small ("Hello\n").
If it was large enough to fill libc's buffer and cause a write(2),
then the errors would be returned to the application.
But if the output is small - such errors are lost.

-assaf



reply via email to

[Prev in Thread] Current Thread [Next in Thread]