* [PATCH] copy_file_range: add documentation
@ 2017-03-22 2:10 Eric Wong
0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2017-03-22 2:10 UTC (permalink / raw)
To: sleepy-penguin
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)
--
EW
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2017-03-22 2:10 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-22 2:10 [PATCH] copy_file_range: add documentation Eric Wong
Code repositories for project(s) associated with this public inbox
https://yhbt.net/sleepy_penguin.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).