diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2019-02-13 11:12:30 -0500 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2019-03-06 23:01:19 -0800 |
commit | 0689a4a16f5e80e0c2368f4a68c69ce5f2fdc038 (patch) | |
tree | 60301a8961c72698b44291ecb0473e24c61f923a /mtab.h | |
parent | 7fc960a23eab7fce9f5e0666b1a9b3f5eae832af (diff) | |
download | bfs-0689a4a16f5e80e0c2368f4a68c69ce5f2fdc038.tar.xz |
bftw: Work around d_type being wrong for bind mounts on Linux
C.f. https://savannah.gnu.org/bugs/?54913
C.f. https://lkml.org/lkml/2019/2/11/2027
Fixes https://github.com/tavianator/bfs/issues/37
Diffstat (limited to 'mtab.h')
-rw-r--r-- | mtab.h | 19 |
1 files changed, 17 insertions, 2 deletions
@@ -22,6 +22,7 @@ #define BFS_MTAB_H #include "stat.h" +#include <stdbool.h> /** * A file system mount table. @@ -31,7 +32,8 @@ struct bfs_mtab; /** * Parse the mount table. * - * @return The parsed mount table, or NULL on error. + * @return + * The parsed mount table, or NULL on error. */ struct bfs_mtab *parse_bfs_mtab(void); @@ -42,12 +44,25 @@ struct bfs_mtab *parse_bfs_mtab(void); * The current mount table. * @param statbuf * The bfs_stat() buffer for the file in question. - * @return The type of file system containing this file, "unknown" if not known, + * @return + * The type of file system containing this file, "unknown" if not known, * or NULL on error. */ const char *bfs_fstype(const struct bfs_mtab *mtab, const struct bfs_stat *statbuf); /** + * Check if a file could be a mount point. + * + * @param mtab + * The current mount table. + * @param path + * The path to check. + * @return + * Whether the named file could be a mount point. + */ +bool bfs_maybe_mount(const struct bfs_mtab *mtab, const char *path); + +/** * Free a mount table. */ void free_bfs_mtab(struct bfs_mtab *mtab); |