]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
stat-util: expose fd_is_read_only_fs()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 13 Mar 2024 16:59:03 +0000 (01:59 +0900)
committerMike Yuan <me@yhndnzj.com>
Thu, 14 Mar 2024 15:45:27 +0000 (23:45 +0800)
Currently it is not used, but the fucntion is already quite generic and
useful.

src/basic/stat-util.c
src/basic/stat-util.h

index 4040b172268f8b02f7a506a843de2877dc6c81d0..c208d7c59dcd3d47522bfdcb350ba77d855dab12 100644 (file)
@@ -239,7 +239,7 @@ int null_or_empty_path_with_root(const char *fn, const char *root) {
         return null_or_empty(&st);
 }
 
-static int fd_is_read_only_fs(int fd) {
+int fd_is_read_only_fs(int fd) {
         struct statvfs st;
 
         assert(fd >= 0);
index 06bd9fdd97b7840c41328d1aeb0a05e6c367a5be..7556f8f59a6ff44afbe0942fc731b656b9c3fa44 100644 (file)
@@ -45,6 +45,7 @@ static inline int null_or_empty_path(const char *fn) {
         return null_or_empty_path_with_root(fn, NULL);
 }
 
+int fd_is_read_only_fs(int fd);
 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);