aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/copy-file-range.c33
-rw-r--r--lib/gnulib.mk.in12
2 files changed, 45 insertions, 0 deletions
diff --git a/lib/copy-file-range.c b/lib/copy-file-range.c
new file mode 100644
index 00000000000..39b5efbc1cc
--- /dev/null
+++ b/lib/copy-file-range.c
@@ -0,0 +1,33 @@
1/* Stub for copy_file_range
2 Copyright 2019 Free Software Foundation, Inc.
3
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 3 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <https://www.gnu.org/licenses/>. */
16
17#include <config.h>
18
19#include <unistd.h>
20
21#include <errno.h>
22
23ssize_t
24copy_file_range (int infd, off_t *pinoff,
25 int outfd, off_t *poutoff,
26 size_t length, unsigned int flags)
27{
28 /* There is little need to emulate copy_file_range with read+write,
29 since programs that use copy_file_range must fall back on
30 read+write anyway. */
31 errno = ENOSYS;
32 return -1;
33}
diff --git a/lib/gnulib.mk.in b/lib/gnulib.mk.in
index 403d83829cd..6e817fa6897 100644
--- a/lib/gnulib.mk.in
+++ b/lib/gnulib.mk.in
@@ -74,6 +74,7 @@
74# c-strcase \ 74# c-strcase \
75# careadlinkat \ 75# careadlinkat \
76# close-stream \ 76# close-stream \
77# copy-file-range \
77# count-leading-zeros \ 78# count-leading-zeros \
78# count-one-bits \ 79# count-one-bits \
79# count-trailing-zeros \ 80# count-trailing-zeros \
@@ -1274,6 +1275,17 @@ EXTRA_DIST += close-stream.h
1274endif 1275endif
1275## end gnulib module close-stream 1276## end gnulib module close-stream
1276 1277
1278## begin gnulib module copy-file-range
1279ifeq (,$(OMIT_GNULIB_MODULE_copy-file-range))
1280
1281
1282EXTRA_DIST += copy-file-range.c
1283
1284EXTRA_libgnu_a_SOURCES += copy-file-range.c
1285
1286endif
1287## end gnulib module copy-file-range
1288
1277## begin gnulib module count-leading-zeros 1289## begin gnulib module count-leading-zeros
1278ifeq (,$(OMIT_GNULIB_MODULE_count-leading-zeros)) 1290ifeq (,$(OMIT_GNULIB_MODULE_count-leading-zeros))
1279 1291