unix: add non block send and receive flavors for fd passing
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Fri, 10 Jul 2020 12:46:04 +0000 (08:46 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 27 Jul 2020 20:29:49 +0000 (16:29 -0400)
commitb72ce6309a63e5c2ec29042c4677ba559f21746b
tree61ee6d1681e4538fcbf8aa007338cc1126f2dec3
parent44c180cac90d0c2a0486d6bc1aeaf0f1538c1075
unix: add non block send and receive flavors for fd passing

These will be used by the notification subsystem.

It is important to note that based on our current knowledge the sending
/receiving of fds is an all or nothing scenario. The fds are actually
part of the control message instead of the `payload`. On the receiving
side, a reception of N fds will only yield a "read" count of 1 bytes on
reception.

Albeit we don't have to account for the partial send/receive, we have to
manage the EAGAIN/EWOULDBLOCK scenario off non-blocking socket.

The caller of these function must handle the following scenario:

  ret < 0 -> error
  ret == 0 (Nothing received/sent)
  ret > 0 -> success

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: Iabf8de876991c9f1c5b46ea609f9af961c4a7ab9
src/common/unix.c
src/common/unix.h
This page took 0.033744 seconds and 4 git commands to generate.