|
ginnOS
The reference: libc, the libraries and the kernel
|
symbolic links across the mounts, and hard links. More...
Macros | |
| #define | FOLLOW_MAX 40 |
Functions | |
| const char * | vfs_inside_root (const char *path, const char *root) |
| a real path as a process with this root directory sees it. | |
| bool | vfs_join_root (const char *root, const char *virtual_path, char *out, uint32_t size) |
| the real path of a path as a process with this root sees it. | |
| kerr_t | vfs_follow (char *path, uint32_t size, bool follow_last, const char *root) |
| replace the symbolic links along a canonical absolute path by their targets (vfs_link.c). | |
| kerr_t | vfs_readlink (const char *path, char *target, uint32_t size) |
| read the target of the symbolic link at path, with a NUL. | |
| kerr_t | vfs_symlink (const char *path, const char *target) |
| make a symbolic link at path to target. | |
| kerr_t | vfs_link (const char *old_path, const char *new_path) |
| give a file one more name (both paths on one mount, else KERR_INVAL). | |
| kerr_t | vfs_mknod (const char *path, uint32_t mode, uint32_t rdev) |
| make a named pipe or a device node (fs_ops_t mknod). | |
symbolic links across the mounts, and hard links.
the filesystems resolve plain paths only. before an operation, the syscall layer has vfs_follow replace each symbolic link along the path by its target, so the path that reaches the filesystem has no links (but the last name, when the operation acts on a link itself). a target can point into another mount, so each step finds the mount again.
the path is made canonical ("." and ".." removed) before the links are followed, so "link/.." is the directory that holds link, as in a shell's logical mode.
a process can have a root directory of its own (chroot). its paths are then "virtual": "/" is that directory. an absolute link target is taken in the root too, and ".." stops at it.
| #define FOLLOW_MAX 40 |
| const char * vfs_inside_root | ( | const char * | path, |
| const char * | root ) |
a real path as a process with this root directory sees it.
the real path of a path as a process with this root sees it.
replace the symbolic links along a canonical absolute path by their targets (vfs_link.c).
| path | the real path, changed in place. |
| size | the size of the path buffer. |
| follow_last | also the last name, when it is a link. |
| root | the process's root directory ("/" for the real one): an absolute target starts there, and ".." stops there. |
read the target of the symbolic link at path, with a NUL.
| kerr_t vfs_symlink | ( | const char * | path, |
| const char * | target ) |
make a symbolic link at path to target.
| kerr_t vfs_link | ( | const char * | old_path, |
| const char * | new_path ) |
give a file one more name (both paths on one mount, else KERR_INVAL).