Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Fri, 14 May 2021 21:37:37 -0400
From: Dominic Chen <>
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.



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.