summaryrefslogtreecommitdiff
path: root/lib/replace/wscript
diff options
context:
space:
mode:
authorRalph Boehme <slow@samba.org>2021-06-24 14:13:50 +0200
committerJeremy Allison <jra@samba.org>2021-06-30 16:51:29 +0000
commit4dcc04228df233be15efe9c31bcbaba822b140c4 (patch)
tree0d17b381a2aa33956722c477c016c74b1f1b4b4d /lib/replace/wscript
parent7d101c82dfd1a961255fc449d3ec3611b2c21276 (diff)
downloadsamba-4dcc04228df233be15efe9c31bcbaba822b140c4.tar.gz
replace: copy_file_range()
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12033 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'lib/replace/wscript')
-rw-r--r--lib/replace/wscript12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/replace/wscript b/lib/replace/wscript
index 5d6324ef619..12f995f3198 100644
--- a/lib/replace/wscript
+++ b/lib/replace/wscript
@@ -454,6 +454,16 @@ def configure(conf):
conf.CHECK_FUNCS('getpwent_r getpwnam_r getpwuid_r epoll_create')
conf.CHECK_FUNCS('port_create')
conf.CHECK_FUNCS('getprogname')
+ if not conf.CHECK_FUNCS('copy_file_range'):
+ conf.CHECK_CODE('''
+#include <sys/syscall.h>
+#include <unistd.h>
+syscall(SYS_copy_file_range,0,NULL,0,NULL,0,0);
+ ''',
+ 'HAVE_SYSCALL_COPY_FILE_RANGE',
+ msg='Checking whether we have copy_file_range system call')
+ if conf.CONFIG_SET('HAVE_COPY_FILE_RANGE') or conf.CONFIG_SET('HAVE_SYSCALL_COPY_FILE_RANGE'):
+ conf.DEFINE('USE_COPY_FILE_RANGE', 1)
conf.SET_TARGET_TYPE('attr', 'EMPTY')
@@ -835,7 +845,7 @@ REPLACEMENT_FUNCTIONS = {
'strsep', 'strtok_r', 'strtoll', 'strtoull', 'setenv', 'unsetenv',
'utime', 'utimes', 'dup2', 'chown', 'link', 'readlink',
'symlink', 'lchown', 'realpath', 'memmem', 'vdprintf',
- 'dprintf', 'get_current_dir_name',
+ 'dprintf', 'get_current_dir_name', 'copy_file_range',
'strerror_r', 'clock_gettime', 'memset_s'],
'timegm.c': ['timegm'],
# Note: C99_VSNPRINTF is not a function, but a special condition