- change from "ret = 0" to something like "ret = get_errno(safe_write(arg1, NULL, 0))"
- change TARGET_NR_read to do the same, instead of its current short-circuit behaviour for count==0
- check pread64/pwrite64 to see if they need a similar change as well
This happens for me also, with qemu version 2.12.0 (Debian 1:2.12+dfsg-3).
An initial patch was proposed here: https:/ /lists. gnu.org/ archive/ html/qemu- devel/2017- 09/msg08073. html
Discussion pointed out some problems, and the patch languished and was not accepted.
Here is a summary of the changes needed for it to be more likely for the patch to be accepted: https:/ /lists. gnu.org/ archive/ html/qemu- devel/2018- 02/msg03964. html
- change from "ret = 0" to something like "ret = get_errno( safe_write( arg1, NULL, 0))"
- change TARGET_NR_read to do the same, instead of its current short-circuit behaviour for count==0
- check pread64/pwrite64 to see if they need a similar change as well