On 7/31/26 10:14, Paul Eggert via tz wrote:
Thanks for reporting that. It looks like EPERM can also happen on Solaris/Illumos, AIX, and FreeBSD/macOS. This is due to a longstanding confusion dating back to 6th Edition Unix: way back then, hard links to directories were allowed if you were the superuser (this was because there was no mkdir syscall, the mkdir command was setuid root, and it created "." and ".." entries by using the link syscall), and if link(A,B) failed with EACCES it meant you lacked permission to the parent of A or B, whereas if it failed with EPERM it meant that A was a directory and you were not the superuser. As time evolved, for this syscall EPERM came to mean "wrong file type" rather than "permission denied", even though nowadays even the superuser cannot hard link to directories.
macOS Time Machine backup facility uses hard links to directories. If a directory has not been modified it hard links to a prior version. Kids, don't try this at home! MacOS delivers TZ data using copies in place of ssymlinks. Because their package manager doesn't support symlinks Cygwin avoids symbolic links because they don't conform to POSIX. it uses an alternative. -- gil
