diff options
Diffstat (limited to 'templates/man2/copy_file_range.2.pot')
-rw-r--r-- | templates/man2/copy_file_range.2.pot | 783 |
1 files changed, 783 insertions, 0 deletions
diff --git a/templates/man2/copy_file_range.2.pot b/templates/man2/copy_file_range.2.pot new file mode 100644 index 00000000..b1b7f48e --- /dev/null +++ b/templates/man2/copy_file_range.2.pot @@ -0,0 +1,783 @@ +# SOME DESCRIPTIVE TITLE +# Copyright (C) YEAR Free Software Foundation, Inc. +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2024-03-01 16:54+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <LL@li.org>\n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. type: TH +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "copy_file_range" +msgstr "" + +#. type: TH +#: archlinux fedora-40 fedora-rawhide mageia-cauldron +#, no-wrap +msgid "2023-10-31" +msgstr "" + +#. type: TH +#: archlinux fedora-40 fedora-rawhide mageia-cauldron +#, no-wrap +msgid "Linux man-pages 6.06" +msgstr "" + +#. type: SH +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "NAME" +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "copy_file_range - Copy a range of data from one file to another" +msgstr "" + +#. type: SH +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "LIBRARY" +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "Standard C library (I<libc>, I<-lc>)" +msgstr "" + +#. type: SH +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "SYNOPSIS" +msgstr "" + +#. type: Plain text +#: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron +#: opensuse-tumbleweed +#, no-wrap +msgid "" +"B<#define _GNU_SOURCE>\n" +"B<#define _FILE_OFFSET_BITS 64>\n" +"B<#include E<lt>unistd.hE<gt>>\n" +msgstr "" + +#. type: Plain text +#: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron +#: opensuse-tumbleweed +#, no-wrap +msgid "" +"B<ssize_t copy_file_range(int >I<fd_in>B<, off_t *_Nullable >I<off_in>B<,>\n" +"B< int >I<fd_out>B<, off_t *_Nullable >I<off_out>B<,>\n" +"B< size_t >I<len>B<, unsigned int >I<flags>B<);>\n" +msgstr "" + +#. type: SH +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "DESCRIPTION" +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"The B<copy_file_range>() system call performs an in-kernel copy between two " +"file descriptors without the additional cost of transferring data from the " +"kernel to user space and then back into the kernel. It copies up to I<len> " +"bytes of data from the source file descriptor I<fd_in> to the target file " +"descriptor I<fd_out>, overwriting any data that exists within the requested " +"range of the target file." +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"The following semantics apply for I<off_in>, and similar statements apply to " +"I<off_out>:" +msgstr "" + +#. type: IP +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "\\[bu]" +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"If I<off_in> is NULL, then bytes are read from I<fd_in> starting from the " +"file offset, and the file offset is adjusted by the number of bytes copied." +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"If I<off_in> is not NULL, then I<off_in> must point to a buffer that " +"specifies the starting offset where bytes from I<fd_in> will be read. The " +"file offset of I<fd_in> is not changed, but I<off_in> is adjusted " +"appropriately." +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"I<fd_in> and I<fd_out> can refer to the same file. If they refer to the " +"same file, then the source and target ranges are not allowed to overlap." +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"The I<flags> argument is provided to allow for future extensions and " +"currently must be set to 0." +msgstr "" + +#. type: SH +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "RETURN VALUE" +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"Upon successful completion, B<copy_file_range>() will return the number of " +"bytes copied between files. This could be less than the length originally " +"requested. If the file offset of I<fd_in> is at or past the end of file, no " +"bytes are copied, and B<copy_file_range>() returns zero." +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"On error, B<copy_file_range>() returns -1 and I<errno> is set to indicate " +"the error." +msgstr "" + +#. type: SH +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "ERRORS" +msgstr "" + +#. type: TP +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "B<EBADF>" +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "One or more file descriptors are not valid." +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "I<fd_in> is not open for reading; or I<fd_out> is not open for writing." +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"The B<O_APPEND> flag is set for the open file description (see B<open>(2)) " +"referred to by the file descriptor I<fd_out>." +msgstr "" + +#. type: TP +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "B<EFBIG>" +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"An attempt was made to write at a position past the maximum file offset the " +"kernel supports." +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"An attempt was made to write a range that exceeds the allowed maximum file " +"size. The maximum file size differs between filesystem implementations and " +"can be different from the maximum allowed file offset." +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"An attempt was made to write beyond the process's file size resource limit. " +"This may also result in the process receiving a B<SIGXFSZ> signal." +msgstr "" + +#. type: TP +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "B<EINVAL>" +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "The I<flags> argument is not 0." +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"I<fd_in> and I<fd_out> refer to the same file and the source and target " +"ranges overlap." +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "Either I<fd_in> or I<fd_out> is not a regular file." +msgstr "" + +#. type: TP +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "B<EIO>" +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "A low-level I/O error occurred while copying." +msgstr "" + +#. type: TP +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "B<EISDIR>" +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "Either I<fd_in> or I<fd_out> refers to a directory." +msgstr "" + +#. type: TP +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "B<ENOMEM>" +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "Out of memory." +msgstr "" + +#. type: TP +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "B<ENOSPC>" +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"There is not enough space on the target filesystem to complete the copy." +msgstr "" + +#. type: TP +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "B<EOPNOTSUPP> (since Linux 5.19)" +msgstr "" + +#. commit 868f9f2f8e004bfe0d3935b1976f625b2924893b +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "The filesystem does not support this operation." +msgstr "" + +#. type: TP +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "B<EOVERFLOW>" +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"The requested source or destination range is too large to represent in the " +"specified data types." +msgstr "" + +#. type: TP +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "B<EPERM>" +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "I<fd_out> refers to an immutable file." +msgstr "" + +#. type: TP +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "B<ETXTBSY>" +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "Either I<fd_in> or I<fd_out> refers to an active swap file." +msgstr "" + +#. type: TP +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "B<EXDEV> (before Linux 5.3)" +msgstr "" + +#. commit 5dae222a5ff0c269730393018a5539cc970a4726 +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"The files referred to by I<fd_in> and I<fd_out> are not on the same " +"filesystem." +msgstr "" + +#. type: TP +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "B<EXDEV> (since Linux 5.19)" +msgstr "" + +#. commit 868f9f2f8e004bfe0d3935b1976f625b2924893b +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"The files referred to by I<fd_in> and I<fd_out> are not on the same " +"filesystem, and the source and target filesystems are not of the same type, " +"or do not support cross-filesystem copy." +msgstr "" + +#. type: SH +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "VERSIONS" +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"A major rework of the kernel implementation occurred in Linux 5.3. Areas of " +"the API that weren't clearly defined were clarified and the API bounds are " +"much more strictly checked than on earlier kernels." +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"Since Linux 5.19, cross-filesystem copies can be achieved when both " +"filesystems are of the same type, and that filesystem implements support for " +"it. See BUGS for behavior prior to Linux 5.19." +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"Applications should target the behaviour and requirements of Linux 5.19, " +"that was also backported to earlier stable kernels." +msgstr "" + +#. type: SH +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "STANDARDS" +msgstr "" + +#. type: Plain text +#: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron +#: opensuse-leap-15-6 opensuse-tumbleweed +msgid "Linux, GNU." +msgstr "" + +#. type: SH +#: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron +#: opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "HISTORY" +msgstr "" + +#. https://sourceware.org/git/?p=glibc.git;a=commit;f=posix/unistd.h;h=bad7a0c81f501fbbcc79af9eaa4b8254441c4a1f +#. type: Plain text +#: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron +#: opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"Linux 4.5, but glibc 2.27 provides a user-space emulation when it is not " +"available." +msgstr "" + +#. type: SH +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "NOTES" +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"If I<fd_in> is a sparse file, then B<copy_file_range>() may expand any " +"holes existing in the requested range. Users may benefit from calling " +"B<copy_file_range>() in a loop, and using the B<lseek>(2) B<SEEK_DATA> and " +"B<SEEK_HOLE> operations to find the locations of data segments." +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"B<copy_file_range>() gives filesystems an opportunity to implement \"copy " +"acceleration\" techniques, such as the use of reflinks (i.e., two or more " +"inodes that share pointers to the same copy-on-write disk blocks) or server-" +"side-copy (in the case of NFS)." +msgstr "" + +#. type: Plain text +#: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron +#: opensuse-tumbleweed +msgid "" +"B<_FILE_OFFSET_BITS> should be defined to be 64 in code that uses non-null " +"I<off_in> or I<off_out> or that takes the address of B<copy_file_range>, if " +"the code is intended to be portable to traditional 32-bit x86 and ARM " +"platforms where B<off_t>'s width defaults to 32 bits." +msgstr "" + +#. type: SH +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "BUGS" +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"In Linux 5.3 to Linux 5.18, cross-filesystem copies were implemented by the " +"kernel, if the operation was not supported by individual filesystems. " +"However, on some virtual filesystems, the call failed to copy, while still " +"reporting success." +msgstr "" + +#. type: SH +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "EXAMPLES" +msgstr "" + +#. type: Plain text +#: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron +#: opensuse-tumbleweed +#, no-wrap +msgid "" +"#define _GNU_SOURCE\n" +"#define _FILE_OFFSET_BITS 64\n" +"#include E<lt>fcntl.hE<gt>\n" +"#include E<lt>stdio.hE<gt>\n" +"#include E<lt>stdlib.hE<gt>\n" +"#include E<lt>sys/stat.hE<gt>\n" +"#include E<lt>unistd.hE<gt>\n" +"\\&\n" +"int\n" +"main(int argc, char *argv[])\n" +"{\n" +" int fd_in, fd_out;\n" +" off_t len, ret;\n" +" struct stat stat;\n" +"\\&\n" +" if (argc != 3) {\n" +" fprintf(stderr, \"Usage: %s E<lt>sourceE<gt> E<lt>destinationE<gt>\\en\", argv[0]);\n" +" exit(EXIT_FAILURE);\n" +" }\n" +"\\&\n" +" fd_in = open(argv[1], O_RDONLY);\n" +" if (fd_in == -1) {\n" +" perror(\"open (argv[1])\");\n" +" exit(EXIT_FAILURE);\n" +" }\n" +"\\&\n" +" if (fstat(fd_in, &stat) == -1) {\n" +" perror(\"fstat\");\n" +" exit(EXIT_FAILURE);\n" +" }\n" +"\\&\n" +" len = stat.st_size;\n" +"\\&\n" +" fd_out = open(argv[2], O_CREAT | O_WRONLY | O_TRUNC, 0644);\n" +" if (fd_out == -1) {\n" +" perror(\"open (argv[2])\");\n" +" exit(EXIT_FAILURE);\n" +" }\n" +"\\&\n" +" do {\n" +" ret = copy_file_range(fd_in, NULL, fd_out, NULL, len, 0);\n" +" if (ret == -1) {\n" +" perror(\"copy_file_range\");\n" +" exit(EXIT_FAILURE);\n" +" }\n" +"\\&\n" +" len -= ret;\n" +" } while (len E<gt> 0 && ret E<gt> 0);\n" +"\\&\n" +" close(fd_in);\n" +" close(fd_out);\n" +" exit(EXIT_SUCCESS);\n" +"}\n" +msgstr "" + +#. SRC END +#. type: SH +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "SEE ALSO" +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "B<lseek>(2), B<sendfile>(2), B<splice>(2)" +msgstr "" + +#. type: TH +#: debian-bookworm +#, no-wrap +msgid "2023-02-05" +msgstr "" + +#. type: TH +#: debian-bookworm +#, no-wrap +msgid "Linux man-pages 6.03" +msgstr "" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +"B<#define _GNU_SOURCE>\n" +"B<#include E<lt>unistd.hE<gt>>\n" +msgstr "" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +"B<ssize_t copy_file_range(int >I<fd_in>B<, off64_t *_Nullable >I<off_in>B<,>\n" +"B< int >I<fd_out>B<, off64_t *_Nullable >I<off_out>B<,>\n" +"B< size_t >I<len>B<, unsigned int >I<flags>B<);>\n" +msgstr "" + +#. https://sourceware.org/git/?p=glibc.git;a=commit;f=posix/unistd.h;h=bad7a0c81f501fbbcc79af9eaa4b8254441c4a1f +#. type: Plain text +#: debian-bookworm +msgid "" +"The B<copy_file_range>() system call first appeared in Linux 4.5, but glibc " +"2.27 provides a user-space emulation when it is not available." +msgstr "" + +#. type: Plain text +#: debian-bookworm +msgid "" +"The B<copy_file_range>() system call is a nonstandard Linux and GNU " +"extension." +msgstr "" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +"#define _GNU_SOURCE\n" +"#include E<lt>fcntl.hE<gt>\n" +"#include E<lt>stdio.hE<gt>\n" +"#include E<lt>stdlib.hE<gt>\n" +"#include E<lt>sys/stat.hE<gt>\n" +"#include E<lt>unistd.hE<gt>\n" +msgstr "" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +"int\n" +"main(int argc, char *argv[])\n" +"{\n" +" int fd_in, fd_out;\n" +" off64_t len, ret;\n" +" struct stat stat;\n" +msgstr "" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +" if (argc != 3) {\n" +" fprintf(stderr, \"Usage: %s E<lt>sourceE<gt> E<lt>destinationE<gt>\\en\", argv[0]);\n" +" exit(EXIT_FAILURE);\n" +" }\n" +msgstr "" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +" fd_in = open(argv[1], O_RDONLY);\n" +" if (fd_in == -1) {\n" +" perror(\"open (argv[1])\");\n" +" exit(EXIT_FAILURE);\n" +" }\n" +msgstr "" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +" if (fstat(fd_in, &stat) == -1) {\n" +" perror(\"fstat\");\n" +" exit(EXIT_FAILURE);\n" +" }\n" +msgstr "" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid " len = stat.st_size;\n" +msgstr "" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +" fd_out = open(argv[2], O_CREAT | O_WRONLY | O_TRUNC, 0644);\n" +" if (fd_out == -1) {\n" +" perror(\"open (argv[2])\");\n" +" exit(EXIT_FAILURE);\n" +" }\n" +msgstr "" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +" do {\n" +" ret = copy_file_range(fd_in, NULL, fd_out, NULL, len, 0);\n" +" if (ret == -1) {\n" +" perror(\"copy_file_range\");\n" +" exit(EXIT_FAILURE);\n" +" }\n" +msgstr "" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +" len -= ret;\n" +" } while (len E<gt> 0 && ret E<gt> 0);\n" +msgstr "" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +" close(fd_in);\n" +" close(fd_out);\n" +" exit(EXIT_SUCCESS);\n" +"}\n" +msgstr "" + +#. type: TH +#: debian-unstable opensuse-tumbleweed +#, no-wrap +msgid "2023-07-15" +msgstr "" + +#. type: TH +#: debian-unstable opensuse-tumbleweed +#, no-wrap +msgid "Linux man-pages 6.05.01" +msgstr "" + +#. type: TH +#: opensuse-leap-15-6 +#, no-wrap +msgid "2023-03-30" +msgstr "" + +#. type: TH +#: opensuse-leap-15-6 +#, no-wrap +msgid "Linux man-pages 6.04" +msgstr "" |