hjl / source-git / glibc

Forked from source-git/glibc 3 years ago
Clone

Blame support/xcopy_file_range.c

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