directory-handle: make lttng_directory_handle_stat public
[lttng-tools.git] / src / common / compat / directory-handle.h
index 5974e36e35538cac553dd22daf81b1d24aba9410..551fa50b439b84c85cc6d2bfa667943836973454 100644 (file)
@@ -18,8 +18,9 @@
 #ifndef _COMPAT_DIRECTORY_HANDLE_H
 #define _COMPAT_DIRECTORY_HANDLE_H
 
-#include <common/macros.h>
 #include <common/credentials.h>
+#include <common/macros.h>
+#include <sys/stat.h>
 #include <urcu/ref.h>
 
 enum lttng_directory_handle_rmdir_recursive_flags {
@@ -37,6 +38,7 @@ enum lttng_directory_handle_rmdir_recursive_flags {
 #ifdef COMPAT_DIRFD
 struct lttng_directory_handle {
        struct urcu_ref ref;
+       ino_t directory_inode;
        int dirfd;
 };
 
@@ -256,4 +258,22 @@ int lttng_directory_handle_remove_subdirectory_recursive_as_user(
                const struct lttng_credentials *creds,
                int flags);
 
+/*
+ * stat() a file relative to a directory handle.
+ */
+LTTNG_HIDDEN
+int lttng_directory_handle_stat(
+               const struct lttng_directory_handle *handle,
+               const char *name,
+               struct stat *stat_buf);
+
+/*
+ * Compare two directory handles.
+ *
+ * Returns true if the two directory handles are equal, false otherwise.
+ */
+LTTNG_HIDDEN
+bool lttng_directory_handle_equals(const struct lttng_directory_handle *lhs,
+               const struct lttng_directory_handle *rhs);
+
 #endif /* _COMPAT_PATH_HANDLE_H */
This page took 0.024232 seconds and 4 git commands to generate.