Collin Funk <collin.fu...@gmail.com> writes: > 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.
I just remembered that sync_file_range also exists. The symbol isn't in libc.so on GNU/Hurd so not even a stub is provided. Documented with the attached patch. Collin
>From f50bfdb362c91f8926b592fc155d89879808dc03 Mon Sep 17 00:00:00 2001 Message-ID: <f50bfdb362c91f8926b592fc155d89879808dc03.1752896151.git.collin.fu...@gmail.com> From: Collin Funk <collin.fu...@gmail.com> Date: Fri, 18 Jul 2025 20:35:29 -0700 Subject: [PATCH] doc: Mention GNU/Hurd is missing sync_file_range. * doc/glibc-functions/sync_file_range.texi: Add GNU/Hurd to the list of platforms missing sync_file_range. --- ChangeLog | 6 ++++++ doc/glibc-functions/sync_file_range.texi | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index ecb8923da4..87fdf0d51a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2025-07-18 Collin Funk <collin.fu...@gmail.com> + + doc: Mention GNU/Hurd is missing sync_file_range. + * doc/glibc-functions/sync_file_range.texi: Add GNU/Hurd to the list of + platforms missing sync_file_range. + 2025-07-17 Bruno Haible <br...@clisp.org> parse-datetime: Update documentation regarding non-Gregorian calendars. diff --git a/doc/glibc-functions/sync_file_range.texi b/doc/glibc-functions/sync_file_range.texi index b4a6035318..95f8d4e26a 100644 --- a/doc/glibc-functions/sync_file_range.texi +++ b/doc/glibc-functions/sync_file_range.texi @@ -15,5 +15,5 @@ @node sync_file_range @item This function exists only on Linux and is therefore missing on many non-glibc platforms: -glibc 2.5, macOS 14, FreeBSD 14.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 4.3. +glibc 2.5, GNU/Hurd, macOS 14, FreeBSD 14.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 4.3. @end itemize -- 2.50.1