stat-util: introduce path_is_network_fs()

This commit is contained in:
Yu Watanabe
2022-02-04 15:22:20 +09:00
parent 318a53d10a
commit 4e247216e5
2 changed files with 10 additions and 0 deletions
+9
View File
@@ -249,6 +249,15 @@ int path_is_temporary_fs(const char *path) {
return is_temporary_fs(&s);
}
int path_is_network_fs(const char *path) {
struct statfs s;
if (statfs(path, &s) < 0)
return -errno;
return is_network_fs(&s);
}
int stat_verify_regular(const struct stat *st) {
assert(st);
+1
View File
@@ -53,6 +53,7 @@ int fd_is_temporary_fs(int fd);
int fd_is_network_fs(int fd);
int path_is_temporary_fs(const char *path);
int path_is_network_fs(const char *path);
/* Because statfs.t_type can be int on some architectures, we have to cast
* the const magic to the type, otherwise the compiler warns about