stat-util: introduce fd_inode_same

This commit is contained in:
Mike Yuan
2024-03-11 22:53:08 +08:00
parent 14300cdde4
commit 0cdb8df620
2 changed files with 4 additions and 2 deletions
+3 -1
View File
@@ -47,10 +47,12 @@ static inline int null_or_empty_path(const char *fn) {
int path_is_read_only_fs(const char *path);
int inode_same_at(int fda, const char *filea, int fdb, const char *fileb, int flags);
static inline int inode_same(const char *filea, const char *fileb, int flags) {
return inode_same_at(AT_FDCWD, filea, AT_FDCWD, fileb, flags);
}
static inline int fd_inode_same(int fda, int fdb) {
return inode_same_at(fda, NULL, fdb, NULL, AT_EMPTY_PATH);
}
/* The .f_type field of struct statfs is really weird defined on
* different archs. Let's give its type a name. */