patch.diff

Masaki Matsushita, 02/10/2012 02:14 PM

Download (1.25 KB)

View differences:

io.c
2098 2098
#endif
2099 2099
}
2100 2100

  
2101
#ifdef HAVE_POSIX_FADVISE
2102
struct io_advise_struct {
2103
    int fd;
2104
    off_t offset;
2105
    off_t len;
2106
    int advice;
2107
};
2108

  
2109
#ifdef POSIX_FADV_SEQUENTIAL
2110
static VALUE io_advise_internal(void *arg);
2111
#endif /* POSIX_FADV_SEQUENTIAL */
2112
#endif /* HAVE_POSIX_FADVISE */
2113

  
2101 2114
static VALUE
2102 2115
read_all(rb_io_t *fptr, long siz, VALUE str)
2103 2116
{
......
2107 2120
    rb_encoding *enc;
2108 2121
    int cr;
2109 2122

  
2123
#ifdef HAVE_POSIX_FADVISE
2124
#ifdef POSIX_FADV_SEQUENTIAL
2125
    struct io_advise_struct ias;
2126

  
2127
    ias.fd     = fptr->fd;
2128
    ias.advice = POSIX_FADV_SEQUENTIAL;
2129
    ias.offset = 0;
2130
    ias.len = 0;
2131
    io_advise_internal(&ias);
2132
#endif /* POSIX_FADV_SEQUENTIAL */
2133
#endif /* HAVE_POSIX_FADVISE */
2134

  
2110 2135
    if (NEED_READCONV(fptr)) {
2111 2136
	SET_BINARY_MODE(fptr);
2112 2137
	io_setstrbuf(&str,0);
......
7894 7919
             sym_willneed, sym_dontneed, sym_noreuse;
7895 7920

  
7896 7921
#ifdef HAVE_POSIX_FADVISE
7897
struct io_advise_struct {
7898
    int fd;
7899
    off_t offset;
7900
    off_t len;
7901
    int advice;
7902
};
7903

  
7904 7922
static VALUE
7905 7923
io_advise_internal(void *arg)
7906 7924
{