Skip to main content

copy_file_range

Function copy_file_range 

Source
pub fn copy_file_range(
    fd_in: BorrowedFd<'_>,
    offset_in: Option<&mut u64>,
    fd_out: BorrowedFd<'_>,
    offset_out: Option<&mut u64>,
    length: usize,
    flags: u32,
) -> Result<usize, Errno>
Expand description

Copie zero-copy entre deux fichiers (même FS si possible).

Wrappeur de copy_file_range(2) (Linux 4.5+).

§Errors

  • EINVAL : paramètres invalides.
  • EXDEV : FS différents et copy_file_range inter-FS non supporté.

§Examples

use air_sys_syscall::fs::copy_file_range;
use air_sys_types::fd::BorrowedFd;

let n = copy_file_range(src, None, dst, None, 4096, 0)
    .expect("copy_file_range");