From owner-svn-src-all@FreeBSD.ORG Mon Oct 4 15:30:09 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 16DB0106566B; Mon, 4 Oct 2010 15:30:09 +0000 (UTC) (envelope-from ume@mahoroba.org) Received: from mail.mahoroba.org (ent.mahoroba.org [IPv6:2001:2f0:104:8010::1]) by mx1.freebsd.org (Postfix) with ESMTP id B645C8FC16; Mon, 4 Oct 2010 15:30:08 +0000 (UTC) Received: from yuga.mahoroba.org (ume@yuga.mahoroba.org [IPv6:2001:2f0:104:8010:21b:d3ff:fe38:5381]) (user=ume mech=DIGEST-MD5 bits=0) by mail.mahoroba.org (8.14.4/8.14.4) with ESMTP/inet6 id o94FU2SI096918 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 5 Oct 2010 00:30:03 +0900 (JST) (envelope-from ume@mahoroba.org) Date: Tue, 05 Oct 2010 00:30:02 +0900 Message-ID: From: Hajimu UMEMOTO To: Kostik Belousov In-Reply-To: <20101003184925.GA87647@deviant.kiev.zoral.com.ua> References: <201008130639.o7D6dsk1022779@svn.freebsd.org> <20101003184925.GA87647@deviant.kiev.zoral.com.ua> User-Agent: xcite1.60> Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?ISO-2022-JP-2?B?R29qGyQoRCtXGyhC?=) APEL/10.8 Emacs/23.2 (i386-portbld-freebsd8.1) MULE/6.0 (HANACHIRUSATO) X-Operating-System: FreeBSD 8.1-STABLE X-PGP-Key: http://www.imasy.or.jp/~ume/publickey.asc X-PGP-Fingerprint: 1F00 0B9E 2164 70FC 6DC5 BF5F 04E9 F086 BF90 71FE Organization: Internet Mutual Aid Society, YOKOHAMA MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (mail.mahoroba.org [IPv6:2001:2f0:104:8010::1]); Tue, 05 Oct 2010 00:30:03 +0900 (JST) X-Virus-Scanned: clamav-milter 0.96.3 at asuka.mahoroba.org X-Virus-Status: Clean X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, T_RP_MATCHES_RCVD autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on asuka.mahoroba.org 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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2010 15:30:09 -0000 Hi, >>>>> On Sun, 3 Oct 2010 21:49:26 +0300 >>>>> Kostik Belousov said: kostikbel> I suspect there is some subtle issue with the commit present. kostikbel> When getprotobyname_r() is unable to find the protocol, it seems kostikbel> that established behaviour is to return 0 and set *protoent to NULL. The behavior you mentioned is questionable to me. Though I cannot find the manpage of getprotobyname_r(3), there is following description in the manpage of gethostbyname_r(3) on CentOS: Glibc2 also has reentrant versions gethostbyname_r() and gethostbyname2_r(). These return 0 on success and non-zero on error. When getprotobyname_r(3) is unable to find the protocol, it should be treated as error, IMHO. My intention is that when getprotobyname_r(3) ends up with error but errno is zero, the return code should be non-zero (-1). kostikbel> The getprotobyname_r() in HEAD and stable/8, when the protocol kostikbel> cannot be found, return whatever value was present in errno at the time kostikbel> of the call. In anyway, errno should be cleared. I've just committed to clear errno for each method dispatch. kostikbel> When run with the argument "tcp1" on Linux, I get kostikbel> Res 0 errno 0 Success pres (nil) kostikbel> On the recent FreeBSD I get kostikbel> Res 25 errno 25 Inappropriate ioctl for device pres 0x0 kostikbel> (ENOTTY is from stdio). Now, it shows: Res -1 errno 22 Unknown error: 0 pres 0x0 (When strerror(3) is called with 0 for its argument, it set errno to EINVAL.) Sincerely, -- Hajimu UMEMOTO @ Internet Mutual Aid Society Yokohama, Japan ume@mahoroba.org ume@{,jp.}FreeBSD.org http://www.imasy.org/~ume/