From: Jérémie Galarneau Date: Sun, 5 May 2019 22:47:26 +0000 (-0400) Subject: Allow direct access to the dirfd of a directory handle X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=commitdiff_plain;h=facc1162cc341da6eb82a6aef22e6ebf0e97c460 Allow direct access to the dirfd of a directory handle Serialization functions need access to the dirfd of a directory handle in order to pass the fd and re-build the directory handle in another process. This function should not be used for other purposes. It is also only available in the 'enable-dirfd' configuration, which is assumed for the session daemon. Signed-off-by: Jérémie Galarneau --- diff --git a/src/common/compat/directory-handle.h b/src/common/compat/directory-handle.h index fbdc19179..605c3dc81 100644 --- a/src/common/compat/directory-handle.h +++ b/src/common/compat/directory-handle.h @@ -32,6 +32,14 @@ struct lttng_directory_handle { int dirfd; }; + +static inline +int lttng_directory_handle_get_dirfd( + const struct lttng_directory_handle *handle) +{ + return handle->dirfd; +} + #else struct lttng_directory_handle { char *base_path;