From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: poffice@blade.nagaokaut.ac.jp Delivered-To: poffice@blade.nagaokaut.ac.jp Received: from kankan.nagaokaut.ac.jp (kankan.nagaokaut.ac.jp [133.44.2.24]) by blade.nagaokaut.ac.jp (Postfix) with ESMTP id 456BD19E005C for ; Fri, 18 Dec 2015 12:42:31 +0900 (JST) Received: from voscc.nagaokaut.ac.jp (voscc.nagaokaut.ac.jp [133.44.1.100]) by kankan.nagaokaut.ac.jp (Postfix) with ESMTP id 52DA5B5D871 for ; Fri, 18 Dec 2015 13:14:38 +0900 (JST) Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by voscc.nagaokaut.ac.jp (Postfix) with ESMTP id ACB2018CC7D1 for ; Fri, 18 Dec 2015 13:14:38 +0900 (JST) Received: from [221.186.184.76] (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 77917120769; Fri, 18 Dec 2015 13:13:43 +0900 (JST) X-Original-To: ruby-core@ruby-lang.org Delivered-To: ruby-core@ruby-lang.org Received: from mail-io0-f176.google.com (mail-io0-f176.google.com [209.85.223.176]) by neon.ruby-lang.org (Postfix) with ESMTPS id 1EEBA12059B; Fri, 18 Dec 2015 13:13:17 +0900 (JST) Received: by mail-io0-f176.google.com with SMTP id e126so77743009ioa.1; Thu, 17 Dec 2015 20:13:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:message-id:subject:mime-version:content-type; bh=gE5Pj9XdOqmmYHovVahSKnjRtW+FIJlteGNMMIMrL7M=; b=hL79uStgzX1YMxbZqJzt6KgahdNKFeq8KvEW3/OfFA4XVsP28nHe3XDYW6rP2YcT5N Q5L0Ss5jsy3nmF1JR4gmLLKQTAWkQ/PzAOBel+uhqrvQy+muqvhLLyRAh4BF2pExH2v9 IgCB8m99qR6O+9a01anzdcsRdnTEKci2daSGKQPRCJ9qfAuNjVSAXfhaRqF9xR9kyOFC bppcBzmDWV706Vlq4Dg2Ezw3Uxf+9qlRYo5sWO/CO+G0ZZPCVuXoIMFKqfyGM7xuxURd quZN6R8GCsUwGi35PLjD6dWM3+7pWO093BrBJyTmfyqWeUiij6hmS45VIIHfu7YLCO/h ssqA== X-Received: by 10.107.162.137 with SMTP id l131mr2132399ioe.49.1450411995880; Thu, 17 Dec 2015 20:13:15 -0800 (PST) Received: from Josephe-Jones (75-166-130-47.hlrn.qwest.net. [75.166.130.47]) by smtp.gmail.com with ESMTPSA id b184sm2364954iob.36.2015.12.17.20.13.15 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 17 Dec 2015 20:13:15 -0800 (PST) Date: Thu, 17 Dec 2015 21:13:14 -0700 From: Joseph Jones To: Ruby developers Message-ID: X-Mailer: BoxerFree 6.0.4 (321) X-Boxer-Generated: true X-Boxer-IsLike: true MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="567387da_9daf632_16c" X-ML-Name: ruby-core X-Mail-Count: 72337 Cc: ruby-core@ruby-lang.org Subject: [ruby-core:72337] Re: [ruby-cvs:60187] nobu:r53034 (trunk): test_io.rb: fix IO#advise on aarch64-linux X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" --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--