From: Todd C. Miller Subject: Re: [PATCH] link.2: POSIX.1 does not, in fact, mandate file1 to not be a directory To: наб Cc: tech@openbsd.org Date: Wed, 17 Jul 2024 20:28:59 -0600 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. - todd Index: lib/libc/sys/link.2 =================================================================== RCS file: /cvs/src/lib/libc/sys/link.2,v diff -u -p -u -r1.30 link.2 --- 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