• Ingo Molnar's avatar
    [PATCH] splice: add optional input and output offsets · 529565dc
    Ingo Molnar authored
    add optional input and output offsets to sys_splice(), for seekable file
    descriptors:
    
     asmlinkage long sys_splice(int fd_in, loff_t __user *off_in,
                                int fd_out, loff_t __user *off_out,
                                size_t len, unsigned int flags);
    
    semantics are straightforward: f_pos will be updated with the offset
    provided by user-space, before the splice transfer is about to begin.
    Providing a NULL offset pointer means the existing f_pos will be used
    (and updated in situ).  Providing an offset for a pipe results in
    -ESPIPE. Providing an invalid offset pointer results in -EFAULT.
    Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
    Signed-off-by: default avatarJens Axboe <axboe@suse.de>
    529565dc
splice.c 18 KB