directory-handle: query if instance is backed by a file descriptor
[lttng-tools.git] / src / common / compat / directory-handle.h
index 0ad5c851072ab68de75788aeeb42c657dbd19e8c..b6ee8b3846fdc7a70a77f19c295ab49b23bd3555 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 {
@@ -257,6 +258,23 @@ 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);
+
+/*
+ * Returns true if this directory handle is backed by a file
+ * descriptor, false otherwise.
+ */
+LTTNG_HIDDEN
+bool lttng_directory_handle_uses_fd(
+               const struct lttng_directory_handle *handle);
+
 /*
  * Compare two directory handles.
  *
This page took 0.024024 seconds and 5 git commands to generate.