From owner-svn-src-head@FreeBSD.ORG Thu Jul 10 16:10:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C8CE5B95; Thu, 10 Jul 2014 16:10:33 +0000 (UTC) Received: from mail-wi0-x22b.google.com (mail-wi0-x22b.google.com [IPv6:2a00:1450:400c:c05::22b]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 12A4E29FA; Thu, 10 Jul 2014 16:10:32 +0000 (UTC) Received: by mail-wi0-f171.google.com with SMTP id f8so4374390wiw.16 for ; Thu, 10 Jul 2014 09:10:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=KJvNwqT+Dy2QHGXzbCJq63CVS6mHVM1Ob24eGdP0K0M=; b=cl1XM2XtrQ1IrVb719u61s/RQLyC3uIz8qYywzY0/wyMyikZlrcKTHcN7UbVRvEUYL XALWfdvePaYW7CgFPMNouQw/3rAk3BPORJ1qNnQ4DDi6b+DK4DBP/c0ym+/G7EXVQNr2 347KNfC7HWCQOMdbHyE56QhwQv0HytF6vOwHmlW2FdpKsjqNBl228Yy/hWmPK5JwM8K4 w9IzjQL+XGfQ8+nhFFL10fneGFPFQX/ELbihhVEwBREgK24t6H8G1fMzS29XKXTnRBTq rKDFpebl3/HPyLPbjHJVAXhcJ9mWBeHIXEFEtxTF7hDLVBpoV3ANJ3AfSfBQ07lM2Uur GwMA== X-Received: by 10.194.5.103 with SMTP id r7mr58433785wjr.41.1405008629856; Thu, 10 Jul 2014 09:10:29 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by mx.google.com with ESMTPSA id go4sm39792427wjc.39.2014.07.10.09.10.28 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 10 Jul 2014 09:10:29 -0700 (PDT) Sender: Baptiste Daroussin Date: Thu, 10 Jul 2014 18:10:26 +0200 From: Baptiste Daroussin To: Konstantin Belousov Subject: Re: svn commit: r268493 - head/lib/libfetch Message-ID: <20140710161026.GC93051@ivaldir.etoilebsd.net> References: <201407101304.s6AD4rne079137@svn.freebsd.org> <20140710132813.GQ93733@kib.kiev.ua> <20140710135253.GA93051@ivaldir.etoilebsd.net> <20140710160807.GR93733@kib.kiev.ua> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="rQ2U398070+RC21q" Content-Disposition: inline In-Reply-To: <20140710160807.GR93733@kib.kiev.ua> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jul 2014 16:10:33 -0000 --rQ2U398070+RC21q Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jul 10, 2014 at 07:08:07PM +0300, Konstantin Belousov wrote: > On Thu, Jul 10, 2014 at 03:52:53PM +0200, Baptiste Daroussin wrote: > > On Thu, Jul 10, 2014 at 04:28:13PM +0300, Konstantin Belousov wrote: > > > On Thu, Jul 10, 2014 at 01:04:53PM +0000, Baptiste Daroussin wrote: > > > > Author: bapt > > > > Date: Thu Jul 10 13:04:52 2014 > > > > New Revision: 268493 > > > > URL: http://svnweb.freebsd.org/changeset/base/268493 > > > >=20 > > > > Log: > > > > Support EAGAIN in fetch_writev > > > > =20 > > > > Reviewed by: des > > > > Approved by: des > > > >=20 > > > > Modified: > > > > head/lib/libfetch/common.c > > > >=20 > > > > Modified: head/lib/libfetch/common.c > > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D > > > > --- head/lib/libfetch/common.c Thu Jul 10 12:41:58 2014 (r268492) > > > > +++ head/lib/libfetch/common.c Thu Jul 10 13:04:52 2014 (r268493) > > > > @@ -1110,6 +1110,8 @@ fetch_writev(conn_t *conn, struct iovec=20 > > > > errno =3D 0; > > > > pfd.revents =3D 0; > > > > if (poll(&pfd, 1, deltams) < 0) { > > > > + if (errno =3D=3D EAGAIN) > > > > + continue; > > > > if (errno =3D=3D EINTR && fetchRestartCalls) > > > > continue; > > > > return (-1); > > >=20 > > > How is this error possible ? poll(2) converts EAGAIN from seltdwait(9) > > > to no error. > >=20 > > For posix compliance, libfetch is not only used on FreeBSD, reading at: > > http://pubs.opengroup.org/onlinepubs/009695399/functions/poll.html I ca= n read: > >=20 > > [EAGAIN] > > The allocation of internal data structures failed but a subsequent = request > > may succeed. > >=20 > > Am I missing something? >=20 > At least for me, it was very surprising. I accustomed to the facts that > poll(2) is never restarted after signal, and that you only should test > for EINTR as the error condition. >=20 > Apparently, the behaviour of converting EAGAIN to no error can be tracked > back to at least 4.4 lite. On the other hand, just looking into the man > page for poll(2) on STREAMS-based systems indeed mention EAGAIN. >=20 > My suggestion is to add a comment, noting that FreeBSD does not return > EAGAIN from poll(2), but SUSv4 allows it. This way, the addition would > be not removed in some code cleanup. Does it sound reasonable ? More that reasonable (I was thinking something like this as well) I will do= it tomorrow. regards, Bapt --rQ2U398070+RC21q Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEARECAAYFAlO+uvIACgkQ8kTtMUmk6EwRagCeIIKz7YvRKpSwReQZYOOc0UW/ MpUAoKbff+G4wXKDurmvEqaSZpr0TbN5 =NzBW -----END PGP SIGNATURE----- --rQ2U398070+RC21q--