From 50432108fb3ef826301626b94c5e82ad2ab2bd75 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Mon, 8 Jan 2018 21:43:23 -0500 Subject: 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. --- util.h | 30 ++---------------------------- 1 file changed, 2 insertions(+), 28 deletions(-) (limited to 'util.h') diff --git a/util.h b/util.h index efeea19..81caf12 100644 --- a/util.h +++ b/util.h @@ -23,22 +23,11 @@ #include #include #include -#include +#include #include // 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); -- cgit v1.2.3