Paul Eggert <yyyyyy@xxxxxxxxxxx> wrote:
> So (unless I'm missing something) in this particular detail *BSD has
> stuck with POSIX rather than the traditional Unix behavior as
> supported by the Solaris default environment and by GNU/Linux.
The traditional BSD behavior has been to follow symbolic links. They
have been introduced with 4.2BSD, and its source code for link() in
/usr/src/sys/sys/ufs_syscalls.c calls "namei(uchar, LOOKUP, 1)" to
resolve the target name. In ufs_nami.c, that function is defined as
"namei(func, flag, follow)" where, according to the comment above,
"The follow argument is 1 when symbolic links are to be followed when
they occur at the end of the name translation process."
The full line of the code for link() in ufs_syscalls.c is
ip = namei(uchar, LOOKUP, 1); /* well, this routine is doomed anyhow */
I can only speculate about the intention behind the comment.
I do not have access to the SVR4 sources or to a running system from
the early 90's. It is possible that the historic SVR4 behavior of
link() has indeed been to create hard links to symbolic links.
Gunnar
|