Created attachment 7559 [details]
Patch for syscall.c
Using rsync under FreeBSD with hard links and files having schg set result in EPERM "Operation not permitted". This behavior can be observed if rsyncing /usr/bin/.
The patch fileflags.diff tries to deal with this situation but changes the flags of the parent directory only. It doesn't change the flags of the files itself.
do_link() in syscall.c has to be fixed. patch-syscall.c.txt is a patch which have the be applied after fileflags.diff.