diff --git a/io.c b/io.c index 5412639..095da32 100644 --- a/io.c +++ b/io.c @@ -2087,6 +2087,11 @@ io_setstrbuf(VALUE *str,long len) rb_str_modify_expand(*str, len); } +static VALUE sym_sequential; +#if defined(HAVE_POSIX_FADVISE) && defined(POSIX_FADV_SEQUENTIAL) +static VALUE do_io_advise(rb_io_t *fptr, VALUE advice, off_t offset, off_t len); +#endif + static VALUE read_all(rb_io_t *fptr, long siz, VALUE str) { @@ -2096,6 +2101,10 @@ read_all(rb_io_t *fptr, long siz, VALUE str) rb_encoding *enc; int cr; +#if defined(HAVE_POSIX_FADVISE) && defined(POSIX_FADV_SEQUENTIAL) + do_io_advise(fptr, sym_sequential, (off_t)0LL, (off_t)0LL); +#endif + if (NEED_READCONV(fptr)) { SET_BINARY_MODE(fptr); io_setstrbuf(&str,0); @@ -7875,7 +7884,7 @@ select_end(VALUE arg) return Qnil; } -static VALUE sym_normal, sym_sequential, sym_random, +static VALUE sym_normal, sym_random, sym_willneed, sym_dontneed, sym_noreuse; #ifdef HAVE_POSIX_FADVISE