Debian Codegraph @

templates/man2/copy_file_range.2.pot

raw
1 # SOME DESCRIPTIVE TITLE
2 # Copyright (C) YEAR Free Software Foundation, Inc.
3 # This file is distributed under the same license as the PACKAGE package.
4 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5 #
6 #, fuzzy
7 msgid ""
8 msgstr ""
9 "Project-Id-Version: PACKAGE VERSION\n"
10 "POT-Creation-Date: 2026-06-05 06:21+0200\n"
11 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
12 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13 "Language-Team: LANGUAGE <[email protected]>\n"
14 "Language: \n"
15 "MIME-Version: 1.0\n"
16 "Content-Type: text/plain; charset=UTF-8\n"
17 "Content-Transfer-Encoding: 8bit\n"
18
19 #. type: TH
20 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
21 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
22 #, no-wrap
23 msgid "copy_file_range"
24 msgstr ""
25
26 #. type: TH
27 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
28 #: opensuse-tumbleweed
29 #, no-wrap
30 msgid "2026-02-08"
31 msgstr ""
32
33 #. type: TH
34 #: archlinux debian-unstable
35 #, no-wrap
36 msgid "Linux man-pages 6.18"
37 msgstr ""
38
39 #. type: SH
40 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
41 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
42 #, no-wrap
43 msgid "NAME"
44 msgstr ""
45
46 #. type: Plain text
47 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
48 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
49 msgid "copy_file_range - Copy a range of data from one file to another"
50 msgstr ""
51
52 #. type: SH
53 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
54 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
55 #, no-wrap
56 msgid "LIBRARY"
57 msgstr ""
58
59 #. type: Plain text
60 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
61 #: opensuse-leap-16-1 opensuse-tumbleweed
62 msgid "Standard C library (I<libc>,\\ I<-lc>)"
63 msgstr ""
64
65 #. type: SH
66 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
67 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
68 #, no-wrap
69 msgid "SYNOPSIS"
70 msgstr ""
71
72 #. type: Plain text
73 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
74 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
75 #, no-wrap
76 msgid ""
77 "B<#define _GNU_SOURCE>\n"
78 "B<#define _FILE_OFFSET_BITS 64>\n"
79 "B<#include E<lt>unistd.hE<gt>>\n"
80 msgstr ""
81
82 #. type: Plain text
83 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
84 #: opensuse-leap-16-1 opensuse-tumbleweed
85 #, no-wrap
86 msgid ""
87 "B<ssize_t copy_file_range(int >I<fd_in>B<, off_t *_Nullable >I<off_in>B<,>\n"
88 "B< int >I<fd_out>B<, off_t *_Nullable >I<off_out>B<,>\n"
89 "B< size_t >I<size>B<, unsigned int >I<flags>B<);>\n"
90 msgstr ""
91
92 #. type: SH
93 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
94 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
95 #, no-wrap
96 msgid "DESCRIPTION"
97 msgstr ""
98
99 #. type: Plain text
100 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
101 #: opensuse-leap-16-1 opensuse-tumbleweed
102 msgid ""
103 "The B<copy_file_range>() system call performs an in-kernel copy between two "
104 "file descriptors without the additional cost of transferring data from the "
105 "kernel to user space and then back into the kernel. It copies up to I<size> "
106 "bytes of data from the source file descriptor I<fd_in> to the target file "
107 "descriptor I<fd_out>, overwriting any data that exists within the requested "
108 "range of the target file."
109 msgstr ""
110
111 #. type: Plain text
112 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
113 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
114 msgid ""
115 "The following semantics apply for I<off_in>, and similar statements apply to "
116 "I<off_out>:"
117 msgstr ""
118
119 #. type: IP
120 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
121 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
122 #, no-wrap
123 msgid "\\[bu]"
124 msgstr ""
125
126 #. type: Plain text
127 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
128 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
129 msgid ""
130 "If I<off_in> is NULL, then bytes are read from I<fd_in> starting from the "
131 "file offset, and the file offset is adjusted by the number of bytes copied."
132 msgstr ""
133
134 #. type: Plain text
135 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
136 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
137 msgid ""
138 "If I<off_in> is not NULL, then I<off_in> must point to a buffer that "
139 "specifies the starting offset where bytes from I<fd_in> will be read. The "
140 "file offset of I<fd_in> is not changed, but I<off_in> is adjusted "
141 "appropriately."
142 msgstr ""
143
144 #. type: Plain text
145 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
146 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
147 msgid ""
148 "I<fd_in> and I<fd_out> can refer to the same file. If they refer to the "
149 "same file, then the source and target ranges are not allowed to overlap."
150 msgstr ""
151
152 #. type: Plain text
153 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
154 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
155 msgid ""
156 "The I<flags> argument is provided to allow for future extensions and "
157 "currently must be set to 0."
158 msgstr ""
159
160 #. type: SH
161 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
162 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
163 #, no-wrap
164 msgid "RETURN VALUE"
165 msgstr ""
166
167 #. type: Plain text
168 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
169 #: opensuse-leap-16-1 opensuse-tumbleweed
170 msgid ""
171 "Upon successful completion, B<copy_file_range>() will return the number of "
172 "bytes copied between files. This could be less than the size originally "
173 "requested. If the file offset of I<fd_in> is at or past the end of file, no "
174 "bytes are copied, and B<copy_file_range>() returns zero."
175 msgstr ""
176
177 #. type: Plain text
178 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
179 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
180 msgid ""
181 "On error, B<copy_file_range>() returns -1 and I<errno> is set to indicate "
182 "the error."
183 msgstr ""
184
185 #. type: SH
186 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
187 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
188 #, no-wrap
189 msgid "ERRORS"
190 msgstr ""
191
192 #. type: TP
193 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
194 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
195 #, no-wrap
196 msgid "B<EBADF>"
197 msgstr ""
198
199 #. type: Plain text
200 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
201 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
202 msgid "One or more file descriptors are not valid."
203 msgstr ""
204
205 #. type: Plain text
206 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
207 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
208 msgid "I<fd_in> is not open for reading; or I<fd_out> is not open for writing."
209 msgstr ""
210
211 #. type: Plain text
212 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
213 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
214 msgid ""
215 "The B<O_APPEND> flag is set for the open file description (see B<open>(2)) "
216 "referred to by the file descriptor I<fd_out>."
217 msgstr ""
218
219 #. type: TP
220 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
221 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
222 #, no-wrap
223 msgid "B<EFBIG>"
224 msgstr ""
225
226 #. type: Plain text
227 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
228 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
229 msgid ""
230 "An attempt was made to write at a position past the maximum file offset the "
231 "kernel supports."
232 msgstr ""
233
234 #. type: Plain text
235 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
236 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
237 msgid ""
238 "An attempt was made to write a range that exceeds the allowed maximum file "
239 "size. The maximum file size differs between filesystem implementations and "
240 "can be different from the maximum allowed file offset."
241 msgstr ""
242
243 #. type: Plain text
244 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
245 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
246 msgid ""
247 "An attempt was made to write beyond the process's file size resource limit. "
248 "This may also result in the process receiving a B<SIGXFSZ> signal."
249 msgstr ""
250
251 #. type: TP
252 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
253 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
254 #, no-wrap
255 msgid "B<EINVAL>"
256 msgstr ""
257
258 #. type: Plain text
259 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
260 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
261 msgid "The I<flags> argument is not 0."
262 msgstr ""
263
264 #. type: Plain text
265 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
266 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
267 msgid ""
268 "I<fd_in> and I<fd_out> refer to the same file and the source and target "
269 "ranges overlap."
270 msgstr ""
271
272 #. type: Plain text
273 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
274 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
275 msgid "Either I<fd_in> or I<fd_out> is not a regular file."
276 msgstr ""
277
278 #. type: TP
279 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
280 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
281 #, no-wrap
282 msgid "B<EIO>"
283 msgstr ""
284
285 #. type: Plain text
286 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
287 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
288 msgid "A low-level I/O error occurred while copying."
289 msgstr ""
290
291 #. type: TP
292 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
293 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
294 #, no-wrap
295 msgid "B<EISDIR>"
296 msgstr ""
297
298 #. type: Plain text
299 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
300 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
301 msgid "Either I<fd_in> or I<fd_out> refers to a directory."
302 msgstr ""
303
304 #. type: TP
305 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
306 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
307 #, no-wrap
308 msgid "B<ENOMEM>"
309 msgstr ""
310
311 #. type: Plain text
312 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
313 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
314 msgid "Out of memory."
315 msgstr ""
316
317 #. type: TP
318 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
319 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
320 #, no-wrap
321 msgid "B<ENOSPC>"
322 msgstr ""
323
324 #. type: Plain text
325 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
326 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
327 msgid ""
328 "There is not enough space on the target filesystem to complete the copy."
329 msgstr ""
330
331 #. type: TP
332 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
333 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
334 #, no-wrap
335 msgid "B<EOPNOTSUPP> (since Linux 5.19)"
336 msgstr ""
337
338 #. commit 868f9f2f8e004bfe0d3935b1976f625b2924893b
339 #. type: Plain text
340 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
341 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
342 msgid "The filesystem does not support this operation."
343 msgstr ""
344
345 #. type: TP
346 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
347 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
348 #, no-wrap
349 msgid "B<EOVERFLOW>"
350 msgstr ""
351
352 #. type: Plain text
353 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
354 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
355 msgid ""
356 "The requested source or destination range is too large to represent in the "
357 "specified data types."
358 msgstr ""
359
360 #. type: TP
361 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
362 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
363 #, no-wrap
364 msgid "B<EPERM>"
365 msgstr ""
366
367 #. type: Plain text
368 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
369 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
370 msgid "I<fd_out> refers to an immutable file."
371 msgstr ""
372
373 #. type: TP
374 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
375 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
376 #, no-wrap
377 msgid "B<ETXTBSY>"
378 msgstr ""
379
380 #. type: Plain text
381 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
382 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
383 msgid "Either I<fd_in> or I<fd_out> refers to an active swap file."
384 msgstr ""
385
386 #. type: TP
387 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
388 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
389 #, no-wrap
390 msgid "B<EXDEV> (before Linux 5.3)"
391 msgstr ""
392
393 #. commit 5dae222a5ff0c269730393018a5539cc970a4726
394 #. type: Plain text
395 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
396 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
397 msgid ""
398 "The files referred to by I<fd_in> and I<fd_out> are not on the same "
399 "filesystem."
400 msgstr ""
401
402 #. type: TP
403 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
404 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
405 #, no-wrap
406 msgid "B<EXDEV> (since Linux 5.19)"
407 msgstr ""
408
409 #. commit 868f9f2f8e004bfe0d3935b1976f625b2924893b
410 #. type: Plain text
411 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
412 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
413 msgid ""
414 "The files referred to by I<fd_in> and I<fd_out> are not on the same "
415 "filesystem, and the source and target filesystems are not of the same type, "
416 "or do not support cross-filesystem copy."
417 msgstr ""
418
419 #. type: SH
420 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
421 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
422 #, no-wrap
423 msgid "VERSIONS"
424 msgstr ""
425
426 #. type: Plain text
427 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
428 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
429 msgid ""
430 "A major rework of the kernel implementation occurred in Linux 5.3. Areas of "
431 "the API that weren't clearly defined were clarified and the API bounds are "
432 "much more strictly checked than on earlier kernels."
433 msgstr ""
434
435 #. type: Plain text
436 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
437 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
438 msgid ""
439 "Since Linux 5.19, cross-filesystem copies can be achieved when both "
440 "filesystems are of the same type, and that filesystem implements support for "
441 "it. See BUGS for behavior prior to Linux 5.19."
442 msgstr ""
443
444 #. type: Plain text
445 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
446 #: opensuse-tumbleweed
447 msgid ""
448 "Applications should target the behavior and requirements of Linux 5.19, that "
449 "was also backported to earlier stable kernels."
450 msgstr ""
451
452 #. type: SH
453 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
454 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
455 #, no-wrap
456 msgid "STANDARDS"
457 msgstr ""
458
459 #. type: Plain text
460 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
461 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
462 msgid "Linux, GNU."
463 msgstr ""
464
465 #. type: SH
466 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
467 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
468 #, no-wrap
469 msgid "HISTORY"
470 msgstr ""
471
472 #. type: Plain text
473 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
474 #: opensuse-tumbleweed
475 msgid "Linux 4.5."
476 msgstr ""
477
478 #. glibc.git bad7a0c81f50 (2017-12-22; "copy_file_range: New function to copy file data")
479 #. glibc.git 5a659ccc0ec2 (2019-06-28; "io: Remove copy_file_range emulation [BZ #24744]")
480 #. type: Plain text
481 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
482 #: opensuse-tumbleweed
483 msgid ""
484 "Before glibc 2.30, starting with glibc 2.27, the glibc wrapper function "
485 "provided a user-space fallback implementation when the kernel did not "
486 "implement this system call. Since glibc 2.30, that fallback has been "
487 "removed; the function now fails with ENOSYS if the kernel lacks support "
488 "for .BR copy_file_range ()."
489 msgstr ""
490
491 #. type: SH
492 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
493 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
494 #, no-wrap
495 msgid "NOTES"
496 msgstr ""
497
498 #. type: Plain text
499 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
500 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
501 msgid ""
502 "If I<fd_in> is a sparse file, then B<copy_file_range>() may expand any "
503 "holes existing in the requested range. Users may benefit from calling "
504 "B<copy_file_range>() in a loop, and using the B<lseek>(2) B<SEEK_DATA> and "
505 "B<SEEK_HOLE> operations to find the locations of data segments."
506 msgstr ""
507
508 #. type: Plain text
509 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
510 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
511 msgid ""
512 "B<copy_file_range>() gives filesystems an opportunity to implement \"copy "
513 "acceleration\" techniques, such as the use of reflinks (i.e., two or more "
514 "inodes that share pointers to the same copy-on-write disk blocks) or server-"
515 "side-copy (in the case of NFS)."
516 msgstr ""
517
518 #. type: Plain text
519 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
520 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
521 msgid ""
522 "B<_FILE_OFFSET_BITS> should be defined to be 64 in code that uses non-null "
523 "I<off_in> or I<off_out> or that takes the address of B<copy_file_range>, if "
524 "the code is intended to be portable to traditional 32-bit x86 and ARM "
525 "platforms where B<off_t>'s width defaults to 32 bits."
526 msgstr ""
527
528 #. type: SH
529 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
530 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
531 #, no-wrap
532 msgid "BUGS"
533 msgstr ""
534
535 #. type: Plain text
536 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
537 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
538 msgid ""
539 "In Linux 5.3 to Linux 5.18, cross-filesystem copies were implemented by the "
540 "kernel, if the operation was not supported by individual filesystems. "
541 "However, on some virtual filesystems, the call failed to copy, while still "
542 "reporting success."
543 msgstr ""
544
545 #. type: SH
546 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
547 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
548 #, no-wrap
549 msgid "EXAMPLES"
550 msgstr ""
551
552 #. type: Plain text
553 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
554 #: opensuse-leap-16-1 opensuse-tumbleweed
555 #, no-wrap
556 msgid ""
557 "#define _GNU_SOURCE\n"
558 "#define _FILE_OFFSET_BITS 64\n"
559 "#include E<lt>fcntl.hE<gt>\n"
560 "#include E<lt>stdio.hE<gt>\n"
561 "#include E<lt>stdlib.hE<gt>\n"
562 "#include E<lt>sys/stat.hE<gt>\n"
563 "#include E<lt>sys/types.hE<gt>\n"
564 "#include E<lt>unistd.hE<gt>\n"
565 "\\&\n"
566 "int\n"
567 "main(int argc, char *argv[])\n"
568 "{\n"
569 " int fd_in, fd_out;\n"
570 " off_t size, ret;\n"
571 " struct stat stat;\n"
572 "\\&\n"
573 " if (argc != 3) {\n"
574 " fprintf(stderr, \"Usage: %s E<lt>sourceE<gt> E<lt>destinationE<gt>\\[rs]n\", argv[0]);\n"
575 " exit(EXIT_FAILURE);\n"
576 " }\n"
577 "\\&\n"
578 " fd_in = open(argv[1], O_RDONLY);\n"
579 " if (fd_in == -1) {\n"
580 " perror(\"open (argv[1])\");\n"
581 " exit(EXIT_FAILURE);\n"
582 " }\n"
583 "\\&\n"
584 " if (fstat(fd_in, &stat) == -1) {\n"
585 " perror(\"fstat\");\n"
586 " exit(EXIT_FAILURE);\n"
587 " }\n"
588 "\\&\n"
589 " size = stat.st_size;\n"
590 "\\&\n"
591 " fd_out = open(argv[2], O_CREAT | O_WRONLY | O_TRUNC, 0644);\n"
592 " if (fd_out == -1) {\n"
593 " perror(\"open (argv[2])\");\n"
594 " exit(EXIT_FAILURE);\n"
595 " }\n"
596 "\\&\n"
597 " do {\n"
598 " ret = copy_file_range(fd_in, NULL, fd_out, NULL, size, 0);\n"
599 " if (ret == -1) {\n"
600 " perror(\"copy_file_range\");\n"
601 " exit(EXIT_FAILURE);\n"
602 " }\n"
603 "\\&\n"
604 " size -= ret;\n"
605 " } while (size E<gt> 0 && ret E<gt> 0);\n"
606 "\\&\n"
607 " close(fd_in);\n"
608 " close(fd_out);\n"
609 " exit(EXIT_SUCCESS);\n"
610 "}\n"
611 msgstr ""
612
613 #. SRC END
614 #. type: SH
615 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
616 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
617 #, no-wrap
618 msgid "SEE ALSO"
619 msgstr ""
620
621 #. type: Plain text
622 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
623 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
624 msgid "B<lseek>(2), B<sendfile>(2), B<splice>(2)"
625 msgstr ""
626
627 #. type: TH
628 #: debian-trixie
629 #, no-wrap
630 msgid "2024-06-15"
631 msgstr ""
632
633 #. type: TH
634 #: debian-trixie
635 #, no-wrap
636 msgid "Linux man-pages 6.9.1"
637 msgstr ""
638
639 #. type: Plain text
640 #: debian-trixie
641 msgid "Standard C library (I<libc>, I<-lc>)"
642 msgstr ""
643
644 #. type: Plain text
645 #: debian-trixie
646 #, no-wrap
647 msgid ""
648 "B<ssize_t copy_file_range(int >I<fd_in>B<, off_t *_Nullable >I<off_in>B<,>\n"
649 "B< int >I<fd_out>B<, off_t *_Nullable >I<off_out>B<,>\n"
650 "B< size_t >I<len>B<, unsigned int >I<flags>B<);>\n"
651 msgstr ""
652
653 #. type: Plain text
654 #: debian-trixie
655 msgid ""
656 "The B<copy_file_range>() system call performs an in-kernel copy between two "
657 "file descriptors without the additional cost of transferring data from the "
658 "kernel to user space and then back into the kernel. It copies up to I<len> "
659 "bytes of data from the source file descriptor I<fd_in> to the target file "
660 "descriptor I<fd_out>, overwriting any data that exists within the requested "
661 "range of the target file."
662 msgstr ""
663
664 #. type: Plain text
665 #: debian-trixie
666 msgid ""
667 "Upon successful completion, B<copy_file_range>() will return the number of "
668 "bytes copied between files. This could be less than the length originally "
669 "requested. If the file offset of I<fd_in> is at or past the end of file, no "
670 "bytes are copied, and B<copy_file_range>() returns zero."
671 msgstr ""
672
673 #. type: Plain text
674 #: debian-trixie fedora-44 fedora-rawhide
675 msgid ""
676 "Applications should target the behaviour and requirements of Linux 5.19, "
677 "that was also backported to earlier stable kernels."
678 msgstr ""
679
680 #. https://sourceware.org/git/?p=glibc.git;a=commit;f=posix/unistd.h;h=bad7a0c81f501fbbcc79af9eaa4b8254441c4a1f
681 #. type: Plain text
682 #: debian-trixie fedora-44 fedora-rawhide
683 msgid ""
684 "Linux 4.5, but glibc 2.27 provides a user-space emulation when it is not "
685 "available."
686 msgstr ""
687
688 #. type: Plain text
689 #: debian-trixie
690 #, no-wrap
691 msgid ""
692 "#define _GNU_SOURCE\n"
693 "#define _FILE_OFFSET_BITS 64\n"
694 "#include E<lt>fcntl.hE<gt>\n"
695 "#include E<lt>stdio.hE<gt>\n"
696 "#include E<lt>stdlib.hE<gt>\n"
697 "#include E<lt>sys/stat.hE<gt>\n"
698 "#include E<lt>sys/types.hE<gt>\n"
699 "#include E<lt>unistd.hE<gt>\n"
700 "\\&\n"
701 "int\n"
702 "main(int argc, char *argv[])\n"
703 "{\n"
704 " int fd_in, fd_out;\n"
705 " off_t len, ret;\n"
706 " struct stat stat;\n"
707 "\\&\n"
708 " if (argc != 3) {\n"
709 " fprintf(stderr, \"Usage: %s E<lt>sourceE<gt> E<lt>destinationE<gt>\\[rs]n\", argv[0]);\n"
710 " exit(EXIT_FAILURE);\n"
711 " }\n"
712 "\\&\n"
713 " fd_in = open(argv[1], O_RDONLY);\n"
714 " if (fd_in == -1) {\n"
715 " perror(\"open (argv[1])\");\n"
716 " exit(EXIT_FAILURE);\n"
717 " }\n"
718 "\\&\n"
719 " if (fstat(fd_in, &stat) == -1) {\n"
720 " perror(\"fstat\");\n"
721 " exit(EXIT_FAILURE);\n"
722 " }\n"
723 "\\&\n"
724 " len = stat.st_size;\n"
725 "\\&\n"
726 " fd_out = open(argv[2], O_CREAT | O_WRONLY | O_TRUNC, 0644);\n"
727 " if (fd_out == -1) {\n"
728 " perror(\"open (argv[2])\");\n"
729 " exit(EXIT_FAILURE);\n"
730 " }\n"
731 "\\&\n"
732 " do {\n"
733 " ret = copy_file_range(fd_in, NULL, fd_out, NULL, len, 0);\n"
734 " if (ret == -1) {\n"
735 " perror(\"copy_file_range\");\n"
736 " exit(EXIT_FAILURE);\n"
737 " }\n"
738 "\\&\n"
739 " len -= ret;\n"
740 " } while (len E<gt> 0 && ret E<gt> 0);\n"
741 "\\&\n"
742 " close(fd_in);\n"
743 " close(fd_out);\n"
744 " exit(EXIT_SUCCESS);\n"
745 "}\n"
746 msgstr ""
747
748 #. type: TH
749 #: fedora-44 fedora-rawhide
750 #, no-wrap
751 msgid "2024-11-17"
752 msgstr ""
753
754 #. type: TH
755 #: fedora-44 fedora-rawhide
756 #, no-wrap
757 msgid "Linux man-pages 6.13"
758 msgstr ""
759
760 #. type: TH
761 #: mageia-cauldron
762 #, no-wrap
763 msgid "Linux man-pages 6.17"
764 msgstr ""
765
766 #. type: TH
767 #: opensuse-leap-16-1 opensuse-tumbleweed
768 #, no-wrap
769 msgid "Linux man-pages (unreleased)"
770 msgstr ""