Date: Wed, 22 Sep 2004 07:37:20 +0900 From: JINMEI Tatuya / =?ISO-2022-JP?B?GyRCP0BMQEMjOkgbKEI=?= <jinmei@isl.rdc.toshiba.co.jp> To: Thomas Quinot <thomas@FreeBSD.ORG> Cc: Thomas Quinot <thomas@freebsd.org> Subject: Re: freeaddrinfo(NULL) Message-ID: <y7vd60fgsf3.wl@ocean.jinmei.org> In-Reply-To: <20040921213233.GA84392@melusine.cuivre.fr.eu.org> References: <20040921123016.GA41677@melusine.cuivre.fr.eu.org> <y7visa7h2ki.wl@ocean.jinmei.org> <20040921190717.GG84228@lucky.net> <y7vfz5bgzda.wl@ocean.jinmei.org> <20040921213233.GA84392@melusine.cuivre.fr.eu.org>
next in thread | previous in thread | raw e-mail | index | archive | help
>>>>> On Tue, 21 Sep 2004 23:32:33 +0200, >>>>> Thomas Quinot <thomas@FreeBSD.ORG> said: [...snip] It seems that all these points simply show this is a controversial issue. I was not convinced with the argument for the no-op approach, and still believe segfaulting is better. But at the same time I seem to have failed to convince others who believe in no-op. So I won't make further comments on those. (If you feel this is unfair, please raise the points again.) One last comment about consistency: >> This statement is too short to tell if it's valid, but I believe >> Segfaulting on freeaddrinfo(NULL) can make something safer for the >> reason I described above. That is, catching a bug earlier *can* >> make a safer result. > In some conditions. But we have to take into account the fact that other > systems do behave differently with a NULL pointer in freeaddrinfo (yes, > I am specicly thinking of Linux and Windows), and we may also want to > take *that* into account and find out how we can offer a consistent > interface to programmers. I also believe that it would be friendlier to > programmers to offer a behaviour more similar to free(3). Note also that other *BSDs and Solaris use the "segfault" logic. The freeaddrinfo implementation in the "libbind" library as a part of the ISC BIND package, which many UNIX-like OS vendors adopt (perhaps with vendor-specific modifications though), also segfaults against a NULL argument. So, although consistency might in general be a good thing, the real world's examples show we just have variations. JINMEI, Tatuya Communication Platform Lab. Corporate R&D Center, Toshiba Corp. jinmei@isl.rdc.toshiba.co.jp
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?y7vd60fgsf3.wl>