summaryrefslogtreecommitdiffstats
path: root/stat.h
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2019-05-04 11:51:56 -0400
committerTavian Barnes <tavianator@tavianator.com>2019-05-04 11:55:07 -0400
commitd40691e31e2674d7d95ec9160b9897805ce3f43b (patch)
tree7b2a6c031a2808e7bc9c94e60c708595e3d7e7a8 /stat.h
parentd61c4ed8551e5ef5642f93acec0b5c3f84ebede9 (diff)
downloadbfs-d40691e31e2674d7d95ec9160b9897805ce3f43b.tar.xz
stat: Unify the flags arguments
Diffstat (limited to 'stat.h')
-rw-r--r--stat.h21
1 files changed, 18 insertions, 3 deletions
diff --git a/stat.h b/stat.h
index 59a9712..6c915da 100644
--- a/stat.h
+++ b/stat.h
@@ -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().