When linking a program that uses copy_file_range on GNU/Hurd you will
see the following warning:

    gcc -std=gnu23  -Wno-error -g -O2   -o test-copy-file test-copy-file.o 
libtests.a ../gllib/libgnu.a libtests.a ../gllib/libgnu.a libtests.a  -lacl 
-lattr -lacl      -lbacktrace -lm -lm -lm -lm -lm -lm -lm -lm -lm -lm -lm
    /usr/bin/ld: ../gllib/libgnu.a(copy-file.o): in function 
`copy_file_internal':
    /home/collin/testdir-all/gllib/copy-file.c:88:(.text+0xa7): warning: 
copy_file_range is not implemented and will always fail

This is because Hurd does not implement it and the version included by
glibc just returns ENOSYS, with a link warning.

Nothing needing fixing in Gnulib, since our "replacement" can only
return ENOSYS as well.

But I thought it was worth documenting. Done with the attached.

Collin

>From 07610f0dbe3d209206918af76dea6d1e061e4425 Mon Sep 17 00:00:00 2001
Message-ID: <07610f0dbe3d209206918af76dea6d1e061e4425.1752635988.git.collin.fu...@gmail.com>
From: Collin Funk <collin.fu...@gmail.com>
Date: Tue, 15 Jul 2025 20:16:46 -0700
Subject: [PATCH] doc: Mention copy_file_range stub on GNU/Hurd.

* doc/glibc-functions/copy_file_range.texi: Use @code around errno
constants. Mention that the GNU/Hurd version of this function is just a
stub.
---
 ChangeLog                                | 7 +++++++
 doc/glibc-functions/copy_file_range.texi | 8 ++++++--
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 806e273cf8..d2b4e6c14e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2025-07-15  Collin Funk  <collin.fu...@gmail.com>
+
+	doc: Mention copy_file_range stub on GNU/Hurd.
+	* doc/glibc-functions/copy_file_range.texi: Use @code around errno
+	constants. Mention that the GNU/Hurd version of this function is just a
+	stub.
+
 2025-07-15  Bruno Haible  <br...@clisp.org>
 
 	nstrftime: Add support for non-Gregorian calendars.
diff --git a/doc/glibc-functions/copy_file_range.texi b/doc/glibc-functions/copy_file_range.texi
index 19f180652b..0878fd50fc 100644
--- a/doc/glibc-functions/copy_file_range.texi
+++ b/doc/glibc-functions/copy_file_range.texi
@@ -24,12 +24,16 @@ @node copy_file_range
 This function exists only on Linux and FreeBSD and is therefore
 missing on many platforms:
 glibc 2.26, macOS 14, FreeBSD 12.0, NetBSD 10.0, OpenBSD 7.5, Minix 3.1.8, AIX 7.1, HP-UX 11.31, Solaris 11.4, Cygwin 2.9, mingw, MSVC 14, Android API level 33.
-But the replacement function is only a stub: It always fails with error ENOSYS.
+But the replacement function is only a stub: It always fails with error @code{ENOSYS}.
 
 @item
 This function has many problems on Linux kernel versions before 5.3.
 On these kernel versions, the replacement function always fails with
-error ENOSYS.
+error @code{ENOSYS}.
+
+@item
+This function is provided on GNU/Hurd but it is only a stub: It always
+fails with error @code{ENOSYS}.
 @end itemize
 
 Portability problems not fixed by Gnulib:
-- 
2.50.1

Reply via email to