stat-util: introduce path_is_network_fs()
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user