bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 1/2] copy-file-range: new module


From: Bruno Haible
Subject: Re: [PATCH 1/2] copy-file-range: new module
Date: Thu, 06 Jun 2019 02:45:10 +0200
User-agent: KMail/5.1.3 (Linux/4.4.0-145-generic; KDE/5.18.0; x86_64; ; )

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]