int stat(const char *pathname, struct stat *statbuf);
int fstat(int fd, struct stat *statbuf);
int lstat(const char *pathname, struct stat *statbuf);
...
int fstatat(int dirfd, const char *pathname, struct stat *statbuf,
int flags);
path_filestate_get should be closer to fstatat instead of stat
According to man
path_filestate_get
should be closer tofstatat
instead ofstat