bug-hurd
[Top][All Lists]
Advanced

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

Re: [PATCH 2/4] Avoid multiple definitions of copy_file_range


From: Samuel Thibault
Subject: Re: [PATCH 2/4] Avoid multiple definitions of copy_file_range
Date: Wed, 17 Jan 2024 15:33:06 +0100
User-agent: NeoMutt/20170609 (1.8.3)

Manolo de Medici, le mer. 17 janv. 2024 15:09:39 +0100, a ecrit:
> Hello Philippe,
> thank you for the feedback, I've checked that. The problem is that the
> Hurd fails that test due to the following:
> 
>         #if defined __stub_copy_file_range || defined __stub___copy_file_range
>         fail fail fail this function is not going to work
>         #endifefines the stub __copy_file_ran
> 
> rightfully so I'd say, because copy_file_range is just a stub on the Hurd.

Yes.

> As such, we really need to exclude the code that defines the stub in
> qemu on the Hurd.

But how do things work without the qemu stub?

Or put another way: what problem exactly the presence of the qemu stub
makes?

Samuel

> On Wed, Jan 17, 2024 at 2:56 PM Philippe Mathieu-Daudé
> <philmd@linaro.org> wrote:
> >
> > Hi Manolo,
> >
> > On 17/1/24 13:31, Manolo de Medici wrote:
> > > It's already defined as a stub on the GNU Hurd.
> >
> > Meson checks for this function and defines
> > HAVE_COPY_FILE_RANGE if available, see in meson.build:
> >
> >    config_host_data.set('HAVE_COPY_FILE_RANGE',
> >                         cc.has_function('copy_file_range'))
> >
> > Maybe some header is missing in "osdep.h" for GNU Hurd?
> >
> > > Signed-off-by: Manolo de Medici <manolo.demedici@gmail.com>
> > >
> > > diff --git a/block/file-posix.c b/block/file-posix.c
> > > index 35684f7e21..05426abb7d 100644
> > > --- a/block/file-posix.c
> > > +++ b/block/file-posix.c
> > > @@ -1999,7 +1999,7 @@ static int handle_aiocb_write_zeroes_unmap(void 
> > > *opaque)
> > >       return handle_aiocb_write_zeroes(aiocb);
> > >   }
> > >
> > > -#ifndef HAVE_COPY_FILE_RANGE
> > > +#if !defined(HAVE_COPY_FILE_RANGE) && !defined(__GNU__)
> > >   static off_t copy_file_range(int in_fd, off_t *in_off, int out_fd,
> > >                                off_t *out_off, size_t len, unsigned int 
> > > flags)
> > >   {
> > > ---
> > >   block/file-posix.c | 2 +-
> > >   1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/block/file-posix.c b/block/file-posix.c
> > > index 35684f7e21..05426abb7d 100644
> > > --- a/block/file-posix.c
> > > +++ b/block/file-posix.c
> > > @@ -1999,7 +1999,7 @@ static int handle_aiocb_write_zeroes_unmap(void 
> > > *opaque)
> > >       return handle_aiocb_write_zeroes(aiocb);
> > >   }
> > >
> > > -#ifndef HAVE_COPY_FILE_RANGE
> > > +#if !defined(HAVE_COPY_FILE_RANGE) && !defined(__GNU__)
> > >   static off_t copy_file_range(int in_fd, off_t *in_off, int out_fd,
> > >                                off_t *out_off, size_t len, unsigned int 
> > > flags)
> > >   {
> > > --
> > > 2.43.0
> > >
> >



reply via email to

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