FYI, not sure if this has been discussed before, but I noticed that Solaris supports reflinks via the reflink and reflinkat system calls [1].
Unfortunately, both operate on 2 file names instead of 2 file descriptors, like FICLONE, or 1 file descriptor source and a file name destination, like fclonefileat. It would be nice to support it, but that design makes it trickier than it needs to be. I suppose we could use it if --dereference is used, or when -H is used, and the current file is from the command line? FWIW, it looks like Solaris has 'cp -z' which uses it, and it has -H, -L, and -P to control whether files are dereferenced. Collin [1] https://docs.oracle.com/cd/E86824_01/html/E54766/reflink-3c.html P.S. I also notice Solaris 'cp' supports the options -@ and -/ to control whether extended attributes are copied. I'm not sure that I have seen any other programs use those short options, so it was a bit surprising. It looks like they had plenty of letters left, so I am not sure why they chose those. Perhaps to avoid incompatibilities with ours and other implementations.
