about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2017-03-22 02:07:58 +0000
committerEric Wong <e@80x24.org>2017-03-22 02:09:41 +0000
commitfa2cde77287ea63044153994783f34843bbfd7ec (patch)
tree0ab6eeca42a20b7761df719fa0ebbfb6216fa4b0
parent6a729752abb33d83ff64b8b9e25443785643db6a (diff)
downloadsleepy_penguin-fa2cde77287ea63044153994783f34843bbfd7ec.tar.gz
The public API should be documented, after all.
-rw-r--r--lib/sleepy_penguin/cfr.rb20
1 files changed, 20 insertions, 0 deletions
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)