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)
commit9fe043d73a3e2112f859ce1fa489021a96efecc9
treeb56669c5b01fc420fd0cc026939a31098b3776f0
parent49705576d8779e3fa2b3efc4294bc03261f76935
Add `patient_writev()` function

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
include/share.h
snprintf/patient_write.c
This page took 0.02531 seconds and 4 git commands to generate.