summaryrefslogtreecommitdiff
path: root/include/ruby/io
diff options
context:
space:
mode:
authorSamuel Williams <samuel.williams@oriontransfer.co.nz>2021-12-23 12:20:09 +1300
committerGitHub <noreply@github.com>2021-12-23 12:20:09 +1300
commitbed920f0731a1a89a0e5fc7a7428d21be3ffb8a0 (patch)
tree928abd45556a6f2380211ef347ce0df9c0858db9 /include/ruby/io
parent91c5c1c132994c9ca4540125d462988d83e37a6b (diff)
Add fiber scheduler hooks for `pread`/`pwrite`, and add support to `IO::Buffer`.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/5249 Merged-By: ioquatix <samuel@codeotaku.com>
Diffstat (limited to 'include/ruby/io')
-rw-r--r--include/ruby/io/buffer.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/ruby/io/buffer.h b/include/ruby/io/buffer.h
index 4826a7a76f..907fec20bb 100644
--- a/include/ruby/io/buffer.h
+++ b/include/ruby/io/buffer.h
@@ -80,6 +80,12 @@ VALUE rb_io_buffer_transfer(VALUE self);
void rb_io_buffer_resize(VALUE self, size_t size);
void rb_io_buffer_clear(VALUE self, uint8_t value, size_t offset, size_t length);
+// The length is the minimum required length.
+VALUE rb_io_buffer_read(VALUE self, VALUE io, size_t length);
+VALUE rb_io_buffer_pread(VALUE self, VALUE io, size_t length, off_t offset);
+VALUE rb_io_buffer_write(VALUE self, VALUE io, size_t length);
+VALUE rb_io_buffer_pwrite(VALUE self, VALUE io, size_t length, off_t offset);
+
RBIMPL_SYMBOL_EXPORT_END()
#endif /* RUBY_IO_BUFFER_T */