From fa2cde77287ea63044153994783f34843bbfd7ec Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 22 Mar 2017 02:07:58 +0000 Subject: copy_file_range: add documentation The public API should be documented, after all. --- lib/sleepy_penguin/cfr.rb | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/lib/sleepy_penguin/cfr.rb b/lib/sleepy_penguin/cfr.rb index af94499..01cc4a0 100644 --- a/lib/sleepy_penguin/cfr.rb +++ b/lib/sleepy_penguin/cfr.rb @@ -1,4 +1,24 @@ module SleepyPenguin + + # call-seq: + # SleepyPenguin.copy_file_range(src, dst, len[, keywords]) => # Integer + # + # Performs and in-kernel copy of +len+ bytes from +src+ to +dst+, + # where +src+ and +dst+ are regular files on the same filesystem. + # Returns the number of bytes copied, which may be less than + # requested. + # + # +flags+ is currently unused, but may be specified in the future. + # + # Keywords: + # + # :off_in and :off_out if non-nil may be used to specify an Integer + # offset for each respective descriptor. If specified, the file + # offsets of each file description will not be moved, providing + # pread(2)/pwrite(2)-like semantics. + # + # See copy_file_range(2) manpage for full documentation: + # http://man7.org/linux/man-pages/man2/copy_file_range.2.html def self.copy_file_range(io_in, io_out, len, flags = 0, off_in: nil, off_out: nil) __cfr(io_in, off_in, io_out, off_out, len, flags) -- cgit v1.2.3-24-ge0c7