basic: add make_mount_point_inode helper

Creates a file or a directory depending on the source path, useful
for creating mount points.
This commit is contained in:
Luca Boccassi
2020-12-21 21:48:13 +01:00
committed by Lennart Poettering
parent 9df1e11e31
commit 8bab802910
5 changed files with 91 additions and 28 deletions
+4
View File
@@ -23,3 +23,7 @@ int dev_is_devtmpfs(void);
const char *mount_propagation_flags_to_string(unsigned long flags);
int mount_propagation_flags_from_string(const char *name, unsigned long *ret);
/* Creates a mount point (not parents) based on the source path or stat - ie, a file or a directory */
int make_mount_point_inode_from_stat(const struct stat *st, const char *dest, mode_t mode);
int make_mount_point_inode_from_path(const char *source, const char *dest, mode_t mode);