[scan] Fix for platforms without fcopyfile() or copy_file_range()

Add @cagney's fallback copy function. Use feature tests in configure.ac for
fcopyfile() and copy_file_range().

Fixes #1901
This commit is contained in:
ejurgensen
2025-07-27 22:40:33 +02:00
parent 6a21cad6fd
commit 7b91d43274
2 changed files with 28 additions and 5 deletions

View File

@@ -96,7 +96,13 @@ AC_SEARCH_LIBS([pthread_getthreadid_np], [pthread],
[Define to 1 if you have pthread_getthreadid_np])])
AC_SEARCH_LIBS([uuid_generate_random], [uuid],
[AC_DEFINE([HAVE_UUID], 1,
[Define to 1 if you have uuid_generate_random function])])
[Define to 1 if you have uuid_generate_random])])
AC_SEARCH_LIBS([copy_file_range], [c],
[AC_DEFINE([HAVE_COPY_FILE_RANGE], 1,
[Define to 1 if you have copy_file_range])])
AC_SEARCH_LIBS([fcopyfile], [c],
[AC_DEFINE([HAVE_FCOPYFILE], 1,
[Define to 1 if you have fcopyfile])])
AC_SEARCH_LIBS([log10], [m])
AC_SEARCH_LIBS([lrint], [m])