Re: link(2) creates hard link to symlink in some cases

Alexander V. Lukyanov (lav@video.yars.free.net)
Thu, 26 Dec 1996 14:06:39 +0300 (MSK)


> On Sun, 22 Dec 1996, Bruce Perens wrote:
> > Under 2.0.27, link(2) creates a hard link to a symlink,
> > but only if the target of the symlink exists. This can't
> > be the intended behavior.
>
> From: Mark Hemment <markhe@nextd.demon.co.uk>
> > It may have been the intended behaviour, but it's certainly the wrong
> > behaviour. I test on both SCO's OpenServer, and UnixWare 2.1. Both
> > followed the symlink for link(2). Not sure what a BSD derived system does...

FreeBSD 2.1.5 link() follows symlinks.
Solaris 2.5 does not.

So it seems not so clear which behavior is more correct. Maybe ln
should be patched instead. BTW, what about cross-filesystem symlinks
and symlinks to non-existent files?