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: Philippe Mathieu-Daudé
Subject: Re: [PATCH 2/4] Avoid multiple definitions of copy_file_range
Date: Wed, 17 Jan 2024 14:56:50 +0100
User-agent: Mozilla Thunderbird

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]