From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-2.8 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00 shortcircuit=no autolearn=unavailable version=3.3.2 X-Original-To: ruby-io-splice@bogomips.org Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 9063A633805; Wed, 16 Mar 2016 03:13:46 +0000 (UTC) From: Eric Wong To: sleepy-penguin@bogomips.org Cc: ruby-io-splice@bogomips.org Subject: [sleepy_penguin PATCH 0/2] splice/tee/copy_file_range support Date: Wed, 16 Mar 2016 03:13:38 +0000 Message-Id: <20160316031340.7164-1-e@80x24.org> List-Id: Linux 4.5 was just released the other day with copy_file_range(2) support. This is similar to splice(2), but meant to operate on regular files rather than pipes. copy_file_range(2) does not have glibc support, yet, so it's only supported on x86-64 and x86, for now. Blatantly stealing code from the "io_splice" gem, but omitting vmsplice support for now since I never figured out a good way to use it in Ruby without a mmap(2) wrapper... So with that, I'm planning to slowly phase out the "io_splice" gem since this one absorbs its functionality. And I will add vmsplice support here if we end up supporting mmap, somehow. I also plan to support sendfile as that's another related syscall to these, but may also support a "bsd_sendfile" with support for writing header/trailer vectors... Eric Wong (2): support the splice(2) and tee(2) syscalls implement copy_file_range support for Linux 4.5+ .document | 1 + ext/sleepy_penguin/cfr.c | 68 +++++++++ ext/sleepy_penguin/extconf.rb | 5 + ext/sleepy_penguin/init.c | 5 + ext/sleepy_penguin/sp_copy.h | 50 +++++++ ext/sleepy_penguin/splice.c | 328 ++++++++++++++++++++++++++++++++++++++++++ ext/sleepy_penguin/util.c | 3 + test/test_cfr.rb | 29 ++++ test/test_splice.rb | 254 ++++++++++++++++++++++++++++++++ test/test_splice_eintr.rb | 34 +++++ 10 files changed, 777 insertions(+)