Re:The Rise of "Worse is Better"
by rwmj on Monday July 04, 2011 @06:31AM
(#2726103)
This precise issue in Unix/POSIX causes a huge headache. I wonder how many thousands or millions of "xread/xwrite" loops have been written in user code to retry failed read and write calls, and how many of those loops have bugs?
Look at gnulib to see how hard it is to get these loops right:
Look at gnulib to see how hard it is to get these loops right:
http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob;f=li... http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob;f=li...
In the case of a partial read/write followed by an error, I don't believe it is possible to recover at all using just POSIX-defined calls.