diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2018-01-08 21:43:23 -0500 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2018-01-08 21:52:50 -0500 |
commit | 50432108fb3ef826301626b94c5e82ad2ab2bd75 (patch) | |
tree | ed8946e5ab8bac5adda495e9c8ca67a8ac99fd19 /util.h | |
parent | 7d68aac4a50ab4d4881832bc7de568c2b5d4ea8b (diff) | |
download | bfs-50432108fb3ef826301626b94c5e82ad2ab2bd75.tar.xz |
stat: New wrapper around the stat() family
This lets bfs transparently support the new statx() system call on
Linux, giving it access to file birth times.
Diffstat (limited to 'util.h')
-rw-r--r-- | util.h | 30 |
1 files changed, 2 insertions, 28 deletions
@@ -23,22 +23,11 @@ #include <fnmatch.h> #include <regex.h> #include <stdbool.h> -#include <sys/stat.h> +#include <sys/types.h> #include <time.h> // Some portability concerns -#if __APPLE__ -# define st_atim st_atimespec -# define st_ctim st_ctimespec -# define st_mtim st_mtimespec -# define st_birthtim st_birthtimespec -#endif - -#if __APPLE__ || __FreeBSD__ || __NetBSD__ -# define BFS_HAVE_ST_BIRTHTIM true -#endif - #if !defined(FNM_CASEFOLD) && defined(FNM_IGNORECASE) # define FNM_CASEFOLD FNM_IGNORECASE #endif @@ -167,22 +156,7 @@ int xfaccessat(int fd, const char *path, int amode); bool is_nonexistence_error(int error); /** - * stat() a file, falling back on the link itself for broken symbolic links. - * - * @param fd - * The base directory descriptor. - * @param path - * The path to the file, relative to fd. - * @param buf - * The stat buffer to fill. - * @param flags - * AT_* flags for this call. - * @return 0 on success, -1 on failure. - */ -int xfstatat(int fd, const char *path, struct stat *buf, int flags); - -/** - * Convert a stat() st_mode to a bftw() typeflag. + * Convert a bfs_stat() mode to a bftw() typeflag. */ enum bftw_typeflag mode_to_typeflag(mode_t mode); |