|
Packit Service |
ada5e0 |
/* copy_file_range with error checking.
|
|
Packit Service |
ada5e0 |
Copyright (C) 2018 Free Software Foundation, Inc.
|
|
Packit Service |
ada5e0 |
This file is part of the GNU C Library.
|
|
Packit Service |
ada5e0 |
|
|
Packit Service |
ada5e0 |
The GNU C Library is free software; you can redistribute it and/or
|
|
Packit Service |
ada5e0 |
modify it under the terms of the GNU Lesser General Public
|
|
Packit Service |
ada5e0 |
License as published by the Free Software Foundation; either
|
|
Packit Service |
ada5e0 |
version 2.1 of the License, or (at your option) any later version.
|
|
Packit Service |
ada5e0 |
|
|
Packit Service |
ada5e0 |
The GNU C Library is distributed in the hope that it will be useful,
|
|
Packit Service |
ada5e0 |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit Service |
ada5e0 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit Service |
ada5e0 |
Lesser General Public License for more details.
|
|
Packit Service |
ada5e0 |
|
|
Packit Service |
ada5e0 |
You should have received a copy of the GNU Lesser General Public
|
|
Packit Service |
ada5e0 |
License along with the GNU C Library; if not, see
|
|
Packit Service |
ada5e0 |
<http://www.gnu.org/licenses/>. */
|
|
Packit Service |
ada5e0 |
|
|
Packit Service |
ada5e0 |
#include <support/support.h>
|
|
Packit Service |
ada5e0 |
#include <support/xunistd.h>
|
|
Packit Service |
ada5e0 |
#include <support/check.h>
|
|
Packit Service |
ada5e0 |
|
|
Packit Service |
ada5e0 |
ssize_t
|
|
Packit Service |
ada5e0 |
xcopy_file_range (int infd, off64_t *pinoff, int outfd, off64_t *poutoff,
|
|
Packit Service |
ada5e0 |
size_t length, unsigned int flags)
|
|
Packit Service |
ada5e0 |
{
|
|
Packit Service |
ada5e0 |
ssize_t status = support_copy_file_range (infd, pinoff, outfd,
|
|
Packit Service |
ada5e0 |
poutoff, length, flags);
|
|
Packit Service |
ada5e0 |
if (status == -1)
|
|
Packit Service |
ada5e0 |
FAIL_EXIT1 ("cannot copy file: %m\n");
|
|
Packit Service |
ada5e0 |
return status;
|
|
Packit Service |
ada5e0 |
}
|