Problem copying hard-linked symlinks

Chris Thompson cet1 at
Mon Jun 16 11:51:22 MDT 2014

This begins to feel like sinking further and further into the tar pit ...

Forcibly setting "#define CAN_HARDLINK_SYMLINK 1" in config.h after
configure and then make'ing gives an rsync that is only slightly better
behaved. It doesn't hang any longer (in any combination so far tried),
but rather than hardlinking the first symlink it hardlinks its *target*
(or fails if the target doesn't exist [yet]). Maybe some other config.h
change is necessary as well?

As for why CAN_HARDLINK_SYMLINK doesn't get set in the first place,
that's also still a mystery...

On Jun 16 2014, Wayne Davison wrote:

>I'd imagine that your configure run was done on a filesystem that didn't
>support hardlinked symlinks, since the test program it runs is super simple
>and to the point.

Super simple indeed (although it should probably unlink(FILENAME "2") as
well as FILENAME, but that doesn't seem to help). Here is the relevant
part of config.log checking whether link() can hard-link symlinks cc -xc99=all -o conftest -O -DHAVE_CONFIG_H   conftest.c -lsec -lsocket -lnsl  >&5
"conftest.c", line 166: warning: old-style declaration or incorrect type for: main $? = 0 ./conftest $? = 1 program exited with status 1 failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
[... a whole lot more of these, available if wanted! ...]
| #define UTF8_CHARSET "UTF-8"
| /* end confdefs.h.  */
| # include <unistd.h>
| #endif
| #include <stdlib.h>
| #include <errno.h>
| #define FILENAME "conftest.dangle"
|     main() {
|       unlink(FILENAME);
|       if (symlink("", FILENAME) < 0) abort();
|       if (link(FILENAME, FILENAME "2") < 0) exit(1);
|       exit(0);
|     } result: no

But when I run that exact same program (in the build directory, with all
the #defines's) it gives exit code 0.

Some historical research indicates that something changed here between
rsync 3.0.5 and 3.0.6. I found some old build directories on one
Solaris 10_x86 system (not all made by me, so it doesn't seem to be
a personal idioscyncracy). Running configure now for rsync 3.0.5 still
ends up with CAN_HARDLINK_SYMLINK defined in config.h, so it isn't
an OS patch level thing either.

Chris Thompson
Email: cet1 at

More information about the rsync mailing list