summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
57b1431)
Allow a user of a directory handle to know if a given instance is
backed by a file descriptor. This is needed to ensure the fd-tracker
can accurately track the number of file descriptors in use at a given
moment.
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I64aeeae2623a35ed07964432bb18b16aeeeb89ec
return fstatat(handle->dirfd, path, st, 0);
}
return fstatat(handle->dirfd, path, st, 0);
}
+LTTNG_HIDDEN
+bool lttng_directory_handle_uses_fd(
+ const struct lttng_directory_handle *handle)
+{
+ return handle->dirfd != AT_FDCWD;
+}
+
static
int lttng_directory_handle_mkdir(
const struct lttng_directory_handle *handle,
static
int lttng_directory_handle_mkdir(
const struct lttng_directory_handle *handle,
+LTTNG_HIDDEN
+bool lttng_directory_handle_uses_fd(
+ const struct lttng_directory_handle *handle)
+{
+ return false;
+}
+
static
int lttng_directory_handle_mkdir(const struct lttng_directory_handle *handle,
const char *subdirectory, mode_t mode)
static
int lttng_directory_handle_mkdir(const struct lttng_directory_handle *handle,
const char *subdirectory, mode_t mode)
const char *name,
struct stat *stat_buf);
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.
*
/*
* Compare two directory handles.
*