From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id AF9DD2095B for ; Wed, 22 Mar 2017 02:10:12 +0000 (UTC) From: Eric Wong To: sleepy-penguin@bogomips.org Subject: [PATCH] copy_file_range: add documentation Date: Wed, 22 Mar 2017 02:10:12 +0000 Message-Id: <20170322021012.18993-1-e@80x24.org> List-Id: 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