Skip to content

Commit f9f9e7f

Browse files
committed
Merge branch 'PHP-8.2'
2 parents 8487b55 + c15fe51 commit f9f9e7f

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

configure.ac

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,6 @@ PHP_CHECK_FUNC(socketpair, socket, network)
364364
PHP_CHECK_FUNC(htonl, socket, network)
365365
PHP_CHECK_FUNC(gethostname, nsl, network)
366366
PHP_CHECK_FUNC(gethostbyaddr, nsl, network)
367-
PHP_CHECK_FUNC(copy_file_range)
368367
PHP_CHECK_FUNC(dlopen, dl, root)
369368
PHP_CHECK_FUNC(dlsym, dl, root)
370369
if test "$ac_cv_func_dlopen" = "yes"; then
@@ -695,6 +694,33 @@ if test "$ac_cv_func_getaddrinfo" = yes; then
695694
AC_DEFINE(HAVE_GETADDRINFO,1,[Define if you have the getaddrinfo function])
696695
fi
697696

697+
AC_CACHE_CHECK([for copy_file_range], ac_cv_copy_file_range,
698+
[AC_RUN_IFELSE([AC_LANG_SOURCE([[
699+
#ifdef __linux__
700+
#ifndef _GNU_SOURCE
701+
#define _GNU_SOURCE
702+
#endif
703+
#include <linux/version.h>
704+
#include <unistd.h>
705+
706+
int main(void) {
707+
(void)copy_file_range(-1, 0, -1, 0, 0, 0);
708+
#if LINUX_VERSION_CODE < KERNEL_VERSION(5,3,0)
709+
#error "kernel too old"
710+
#else
711+
return 0;
712+
#endif
713+
}
714+
#else
715+
#error "unsupported platform"
716+
#endif
717+
]])], [ac_cv_copy_file_range=yes], [ac_cv_copy_file_range=no])
718+
])
719+
720+
if test "$ac_cv_copy_file_range" = yes; then
721+
AC_DEFINE(HAVE_COPY_FILE_RANGE,1,[Define if copy_file_range support])
722+
fi
723+
698724
AC_REPLACE_FUNCS(strlcat strlcpy explicit_bzero getopt)
699725
AC_FUNC_ALLOCA
700726
PHP_TIME_R_TYPE

0 commit comments

Comments
 (0)