On 2026-07-31 10:59, Paul Gilmartin via tz wrote:
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 symlinks.
Because their package manager doesn't support symlinks
Cygwin avoids symbolic links because they don't conform to POSIX. it uses an
alternative.
Cygwin uses many alternatives depending on FS:
- create and use reparse points as used by WSL on NT FS with W10 1607+
- will recognize NT FS directory junctions
- create and use AFS and NFS symlinks
- create and use files containing a magic cookie and UTF16LE path with SYSTEM
attribute set on legacy NT or ex/V/FAT/12/16/32 FS
- create and use .lnk shortcuts with RO attribute set on MV FS or similar
see https://cygwin.com/cygwin-ug-net/using.html#pathnames-symlinks
--
Take care. Thanks, Brian Inglis Calgary, Alberta, Canada
La perfection est atteinte Perfection is achieved
non pas lorsqu'il n'y a plus rien à ajouter not when there is no more to add
mais lorsqu'il n'y a plus rien à retrancher but when there is no more to cut
-- Antoine de Saint-Exupéry