Florian Weimer wrote: > This is not a valid implementation of copy_file_range anymore. Please > see the discussion here: > > <https://sourceware.org/ml/libc-alpha/2019-06/msg00039.html> > > If you ship this in gnulib, you should at least call this function by a > different name.
I disagree, for two reasons: 1) Gnulib takes the freedom to adjust the behaviour of functions found in various system libcs. The Gnulib documentation [1] has plenty of examples of this practice. Gnulib typically documents the differences in the corresponding doc section. The doc does not yet have a section regarding copy_file_range, but I'll add it in the next couple of days. Alternatively, Gnulib can also adjust for the "both descriptors refer to the same open file" case, by testing SAME_INODE (instat, outstat) and either using special code with lseek for this case, or just return -1/EINVAL. 2) Shared libraries which use Gnulib functions have various techniques for hiding the Gnulib overrides from the main program, so that the main program can still use the original function from the system libc. If you think that no other source code than libc should define a function that has the same name as copy_file_range, you should better call that function __copy_file_range or kernel_copy_file_range, or similar. Bruno [1] https://www.gnu.org/software/gnulib/manual/gnulib.html