From: Philip Guenther Subject: Re: [PATCH] link.2: POSIX.1 does not, in fact, mandate file1 to not be a directory To: "Todd C. Miller" Cc: наб , tech@openbsd.org Date: Wed, 17 Jul 2024 21:32:34 -0700 On Wed, Jul 17, 2024 at 7:30 PM Todd C. Miller wrote: > > This was changed in rev 1.2 of link.2 in 1996. I don't think we > want to make it sound like this behavior is OpenBSD-specific since > most systems disallow hard links to directories. > > Perhaps something like this. That's clearer, yeah. ok guenther@ > --- lib/libc/sys/link.2 25 Mar 2024 17:57:07 -0000 1.30 > +++ lib/libc/sys/link.2 18 Jul 2024 02:25:00 -0000 > @@ -65,15 +65,13 @@ is removed, the file > .Fa name2 > is not deleted and the link count of the underlying object is decremented. > .Pp > +For the hard link to succeed, > .Fa name1 > -must exist for the hard link to succeed and both > +must exist and not be a directory, and both > .Fa name1 > and > .Fa name2 > must be in the same file system. > -As mandated by POSIX.1 > -.Fa name1 > -may not be a directory. > .Pp > The > .Fn linkat >