diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2019-05-04 11:51:56 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2019-05-04 11:55:07 -0400 |
commit | d40691e31e2674d7d95ec9160b9897805ce3f43b (patch) | |
tree | 7b2a6c031a2808e7bc9c94e60c708595e3d7e7a8 /stat.h | |
parent | d61c4ed8551e5ef5642f93acec0b5c3f84ebede9 (diff) | |
download | bfs-d40691e31e2674d7d95ec9160b9897805ce3f43b.tar.xz |
stat: Unify the flags arguments
Diffstat (limited to 'stat.h')
-rw-r--r-- | stat.h | 21 |
1 files changed, 18 insertions, 3 deletions
@@ -63,8 +63,12 @@ const char *bfs_stat_field_name(enum bfs_stat_field field); * bfs_stat() flags. */ enum bfs_stat_flag { - /** Fall back to the link itself on broken symlinks. */ - BFS_STAT_BROKEN_OK = 1 << 0, + /** Follow symlinks (the default). */ + BFS_STAT_FOLLOW = 0, + /** Never follow symlinks. */ + BFS_STAT_NOFOLLOW = 1 << 0, + /** Try to follow symlinks, but fall back to the link itself if broken. */ + BFS_STAT_TRYFOLLOW = 1 << 1, }; #ifdef DEV_BSIZE @@ -113,8 +117,19 @@ struct bfs_stat { /** * Facade over fstatat(). + * + * @param at_fd + * The base file descriptor for the lookup. + * @param at_path + * The path to stat, relative to at_fd. + * @param flags + * Flags that affect the lookup. + * @param[out] buf + * A place to store the stat buffer, if successful. + * @return + * 0 on success, -1 on error. */ -int bfs_stat(int at_fd, const char *at_path, int at_flags, enum bfs_stat_flag flags, struct bfs_stat *buf); +int bfs_stat(int at_fd, const char *at_path, enum bfs_stat_flag flags, struct bfs_stat *buf); /** * Facade over fstat(). |