summaryrefslogtreecommitdiff
path: root/glnx-dirfd.h
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2016-01-01 17:26:12 -0500
committerColin Walters <walters@verbum.org>2016-01-02 19:42:53 -0500
commit91e060699f5559c49335ce19f4b23ba70dfd6bb3 (patch)
tree78dcfe4ef90591870d54a7a92b905f5fc6872368 /glnx-dirfd.h
parente7f7081054311670411b8ad34f144c99822538c1 (diff)
downloadlibglnx-91e060699f5559c49335ce19f4b23ba70dfd6bb3.tar.gz
dirfd: Add a public API to ensure a filled dtype
It's quite common to iterate over a directory recursively, only caring about the file type, but not other bits returned by `stat()`. Good file systems fill in `dt_type`, but not all do. This function papers over that in userspace conveniently.
Diffstat (limited to 'glnx-dirfd.h')
-rw-r--r--glnx-dirfd.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/glnx-dirfd.h b/glnx-dirfd.h
index 5b7b77a..c13e3dc 100644
--- a/glnx-dirfd.h
+++ b/glnx-dirfd.h
@@ -60,6 +60,10 @@ gboolean glnx_dirfd_iterator_next_dent (GLnxDirFdIterator *dfd_iter,
struct dirent **out_dent,
GCancellable *cancellable,
GError **error);
+gboolean glnx_dirfd_iterator_next_dent_ensure_dtype (GLnxDirFdIterator *dfd_iter,
+ struct dirent **out_dent,
+ GCancellable *cancellable,
+ GError **error);
void glnx_dirfd_iterator_clear (GLnxDirFdIterator *dfd_iter);
G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(GLnxDirFdIterator, glnx_dirfd_iterator_clear)