Add `patient_writev()` function
authorFrancis Deslauriers <francis.deslauriers@efficios.com>
Mon, 30 Mar 2020 21:45:15 +0000 (17:45 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 26 Nov 2020 18:27:49 +0000 (13:27 -0500)
This function wraps the `writev()` function to make it EINTR-aware.

We are going to use this function to send multiple structs in a single
call when dealing with event notifier captures.

This function also supports partial writes even though this should never
happen with event notifier notification. We assert that the data sent is less
then PIPE_BUF in size so to take advantage of the POSIX guarantee for
write atomicity as explained in pipe(7).

The implementation was inspired by this stackoverflow.com post:
https://stackoverflow.com/questions/5853675/techniques-for-handling-short-reads-writes-with-scatter-gather

Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: Ifd1def23f38ab95411fd4550858466451d0468ea


No differences found
This page took 0.025816 seconds and 4 git commands to generate.