On 2013/11/14 12:02:03, bnoordhuis wrote:
...

As to fwrite() writing fewer bytes than requested, I can only speak for glibc
here but when the write() system call fails (including because of EINTR),
glibc
sets the error flag and moves on. It won't try to write again until the next call to fwrite() or fclose(). That second function is especially problematic because if the flush in fclose() fails, the data is gone forever and you end
up
with a truncated file.

I understand what you are saying, and I appreciate that Linux deviates from
POSIX a bit here, but I would still prefer to leave the code as is here. Here
are my reasons:
- the code should work according to POSIX spec of fwrite,
- there does not seem to be an easy way to test the fix (short of writing a
version of write that sometimes writes fewer bytes, which seems to be an
overkill)
- the existing version of ll_prof was doing the same thing. Yes, I admit I just
copy-and-pasted from there.

Thanks.




https://codereview.chromium.org/70013002/

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to