From: Jérémie Galarneau Date: Wed, 22 Jul 2020 20:15:44 +0000 (-0400) Subject: payload: use fd_handle instead of raw file descriptors X-Git-Tag: v2.13.0-rc1~563 X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=commitdiff_plain;h=fe489250ce102edf511e99669025934ec9587c63;hp=fe489250ce102edf511e99669025934ec9587c63 payload: use fd_handle instead of raw file descriptors Using raw file descriptors with lttng_payloads introduces scary file descriptor corner-cases when mixing with asynchroneous communication and lttng_payloads. Since an lttng_payload doesn't own its file descriptors, attempting it is easy to fall into a situation where a file descriptor is referenced by an lttng_payload while the owner is destroyed. For instance, a userspace probe could be destroyed while its description is waiting to be sent to a client. The various use sites of the payload/payload_view APIs are adjusted. Utilities to send/recv fds through unix sockets using the payload and payload view interfaces are added as part of this commit as they use the payload's fd_handles. Signed-off-by: Jérémie Galarneau Change-Id: I44073f1b683af6c475e8e93c25a76910acf955e4 ---