From owner-svn-src-head@FreeBSD.ORG Sun Oct 3 18:49:33 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1430B1065675; Sun, 3 Oct 2010 18:49:33 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 41FAF8FC17; Sun, 3 Oct 2010 18:49:31 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id o93InQ0J063807 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 3 Oct 2010 21:49:26 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id o93InQb5087705; Sun, 3 Oct 2010 21:49:26 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o93InQpJ087704; Sun, 3 Oct 2010 21:49:26 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 3 Oct 2010 21:49:26 +0300 From: Kostik Belousov To: Hajimu UMEMOTO Message-ID: <20101003184925.GA87647@deviant.kiev.zoral.com.ua> References: <201008130639.o7D6dsk1022779@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="uAKRQypu60I7Lcqm" Content-Disposition: inline In-Reply-To: <201008130639.o7D6dsk1022779@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r211276 - head/lib/libc/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 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: Sun, 03 Oct 2010 18:49:33 -0000 --uAKRQypu60I7Lcqm Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Aug 13, 2010 at 06:39:54AM +0000, Hajimu UMEMOTO wrote: > Author: ume > Date: Fri Aug 13 06:39:54 2010 > New Revision: 211276 > URL: http://svn.freebsd.org/changeset/base/211276 >=20 > Log: > - When there is no room for returning the result, nss backend > have to return ERANGE and terminate with NS_RETURN. > - When gethostbyname_r(3) and the friends end with an error, > set errno to the value nss backend returns, and return errno > value. > =20 > PR: kern/131623 > MFC after: 2 weeks I suspect there is some subtle issue with the commit present. When getprotobyname_r() is unable to find the protocol, it seems that established behaviour is to return 0 and set *protoent to NULL. The getprotobyname_r() in HEAD and stable/8, when the protocol cannot be found, return whatever value was present in errno at the time of the call. Below is the example: #include #include #include #include int main(int argc, char *argv[]) { char buf[1024]; struct protoent proto, *pres; int res; res =3D getprotobyname_r(argv[1], &proto, buf, sizeof(buf), &pres); if (res =3D=3D 0 && pres !=3D NULL) printf("Protocol %s num %d (%p %p)\n", proto.p_name, proto.p_proto, &proto, pres); else printf("Res %d errno %d %s pres %p\n", res, errno, strerror(errno), pres); return (0); } When run with the argument "tcp1" on Linux, I get Res 0 errno 0 Success pres (nil) On the recent FreeBSD I get Res 25 errno 25 Inappropriate ioctl for device pres 0x0 (ENOTTY is from stdio). --uAKRQypu60I7Lcqm Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkyo0DUACgkQC3+MBN1Mb4gmeACfa0YqIp8SFgMncR4Tn/DST+JX j8sAoMvKs6MbJxDmuboidMUZxRzhGeJp =B8Dr -----END PGP SIGNATURE----- --uAKRQypu60I7Lcqm--