Introduce and use safe read/write routine
On a POSIX system read/write syscalls can return successfully even when
not all the requested bytes were not read or written.
Introduce 2 wrapper functions to make sure that the read completes only
on EOF (0 bytes) and the write only when the full buffer has been
written out, while still bailing on errors other than -EINTR.
Make use of these new helpers in place of the bare read/write invocation.
Signed-off-by:
Cristian Marussi <cristian.marussi@arm.com>
Loading
Please register or sign in to comment