From 6719107e95a41b9ef241bdaa272eed505865710c Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Thu, 23 Mar 2023 13:59:48 -0400 Subject: dir: New bfs_polldir() function for directory readahead --- src/dir.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/dir.h') diff --git a/src/dir.h b/src/dir.h index e0fe913..6fe7ae2 100644 --- a/src/dir.h +++ b/src/dir.h @@ -79,6 +79,16 @@ struct bfs_dir *bfs_opendir(int at_fd, const char *at_path); */ int bfs_dirfd(const struct bfs_dir *dir); +/** + * Performs any I/O necessary for the next bfs_readdir() call. + * + * @param dir + * The directory to poll. + * @return + * 1 on success, 0 on EOF, or -1 on failure. + */ +int bfs_polldir(struct bfs_dir *dir); + /** * Read a directory entry. * -- cgit v1.2.3