From: Joseph Jones Date: 2015-12-17T21:13:14-07:00 Subject: [ruby-core:72337] Re: [ruby-cvs:60187] nobu:r53034 (trunk): test_io.rb: fix IO#advise on aarch64-linux --567387da_9daf632_16c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Joseph Jones liked your message with Boxer. On December 11, 2015 at 00:48= :34 MST, Eric Wong wrote:nobu=40ruby-lang.org w= rote:> New Revision: 53034> > http://svn.ruby-lang.org/cgi-bin/viewvc.cgi= =3Fview=3Drevision&revision=3D53034> > Log:> test=5Fio.rb: fix IO=23advis= e on aarch64-linux> > * test/ruby/test=5Fio.rb (test=5Fadvise, test=5Fadv= ise=5Fpipe): fadvise on> aarch64-linux returns ESYS.How about we hide ENO= SYS from the user=3FIO=23advise is already a no-op on systems where posix= =5Ffadviseis non-existent at build time.--- a/io.c+++ b/io.c=40=40 -8586,= 7 +8586,7 =40=40 do=5Fio=5Fadvise(rb=5Fio=5Ft *fptr, VALUE advice, off=5F= t offset, off=5Ft len) ias.len =3D len; rv =3D (int)rb=5Fthread=5Fio=5Fb= locking=5Fregion(io=5Fadvise=5Finternal, &ias, fptr->fd);- if (rv) =7B+ i= f (rv && rv =21=3D ENOSYS) =7B /* posix=5Ffadvise(2) doesn't set errno. O= n success it returns 0; otherwise it returns the error code. */ VALUE mes= sage =3D rb=5Fsprintf(=22%=22PRIsVALUE=22 =22 --567387da_9daf632_16c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Joseph Jones liked your message with Boxer.


= On December 11, 2015 at 00:48:34 MST, Eric Wong <normalperson=40yhbt.n= et> wrote:
nobu=40r= uby-lang.org wrote:
> New Revision: 53034
>
> http://= svn.ruby-lang.org/cgi-bin/viewvc.cgi=3Fview=3Drevision&revision=3D53034>
> Log:
> test=5Fio.rb: fix IO=23advise on aarch64-= linux
>
> * test/ruby/test=5Fio.rb (test=5Fadvise, tes= t=5Fadvise=5Fpipe): fadvise on
> aarch64-linux returns ESYS.
How about we hide ENOSYS from the user=3F

IO=23advis= e is already a no-op on systems where posix=5Ffadvise
is non-existen= t at build time.

--- a/io.c
+++ b/io.c
=40=40 -8586,= 7 +8586,7 =40=40 do=5Fio=5Fadvise(rb=5Fio=5Ft *fptr, VALUE advice, off=5F= t offset, off=5Ft len)
ias.len =3D len;

rv = =3D (int)rb=5Fthread=5Fio=5Fblocking=5Fregion(io=5Fadvise=5Finternal, &ia= s, fptr->fd);
- if (rv) =7B
+ if (rv && rv =21=3D ENOSYS)= =7B
/* posix=5Ffadvise(2) doesn't set errno. On success it return= s 0; otherwise
it returns the error code. */
VALUE messa= ge =3D rb=5Fsprintf(=22%=22PRIsVALUE=22 =22
--567387da_9daf632_16c--