>> David Korn ... Donn Terry ...
It looks like POSIX here asks for something that is false in a significant
part of the world of Unix-like systems.
That is not forbidden, but is reasonable only if we agree that what POSIX
asks is much better than the contrary current practice.
The opposite seems to be the case. On systems that implement symbolic
links as files with inode, whether to follow the symlink when a hardlink is
made is a quality-of-implementation matter, where the better choice is
not to follow the symlink.
Really, a symlink is a pathname. The interpretation of that pathname
is time dependent, so that the symlink points at different targets at
different points in time. Also at a single point in time the symlink
may resolve to different files depending on who does the path resolution.
(Think of processes in a chroot jail.)
The possibility of path resolution may depend on permissions, mounts, etc.
The salient property of a hardlink is that if one makes a hardlink
to a file, that file and the newly created hardlink are indistinguishable.
That becomes false if symlinks are followed.
Donn mentions --a "fast symlink" implementation where the symlinks
did not appear as inodes in the filesystem at all, but rather were
"smart" directory entries--
In such a setup, probably the best implementation of hardlinking
to a symlink would be to copy the symlink.
(That would indeed yield indistinguishability, in the absence of
owner, mode, link count etc.)
Andries
|