|
Message-ID: <6f1116b7-0124-6c56-d149-2625049708f1@gmail.com>
Date: Fri, 14 May 2021 21:37:37 -0400
From: Dominic Chen <d.c.ddcc@...il.com>
To: musl@...ts.openwall.com
Subject: [PATCH] __stdio_write: retry on interrupted system call
I've noticed that my C++ application stops printing to stdout after a
while, and I didn't know why. It turns out that printing via
'std::ostream::operator<<' will eventually call '__stdio_write()', which
then calls 'writev()'. But, if 'writev()' is interrupted by a signal and
SA_RESTART is not set, then it will return EINTR, which will cause both
the 'FILE' structure and the corresponding C++ stream to be marked bad.
I think the current behavior is very confusing, so attached is a patch
to retry on EINTR.
Thanks,
Dominic
View attachment "0001-__stdio_write-retry-on-interrupted-system-call.patch" of type "text/plain" (736 bytes)
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.