From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/3950 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: SUN_LEN Date: Wed, 21 Aug 2013 14:07:00 -0400 Message-ID: <20130821180700.GE20515@brightrain.aerifal.cx> References: <20130821144552.GD30088@port70.net> <20130821162339.GY20515@brightrain.aerifal.cx> <20130821163428.GE30088@port70.net> <20130821163645.GZ20515@brightrain.aerifal.cx> <20130821164220.GA20515@brightrain.aerifal.cx> <20130821170036.GF30088@port70.net> <20130821172536.GB20515@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1377108431 12054 80.91.229.3 (21 Aug 2013 18:07:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 21 Aug 2013 18:07:11 +0000 (UTC) To: musl@lists.openwall.com, yukoba@accelart.jp Original-X-From: musl-return-3954-gllmg-musl=m.gmane.org@lists.openwall.com Wed Aug 21 20:07:15 2013 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1VCCoM-0007Di-B5 for gllmg-musl@plane.gmane.org; Wed, 21 Aug 2013 20:07:14 +0200 Original-Received: (qmail 15481 invoked by uid 550); 21 Aug 2013 18:07:13 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 15473 invoked from network); 21 Aug 2013 18:07:13 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:3950 Archived-At: On Thu, Aug 22, 2013 at 02:58:28AM +0900, Yu Kobayashi wrote: > >> Why is it a bad thing to include ? > >> Worry about cyclic dependency? > > Well it puts a lot more stuff into the namespace and has a much larger > > parsing cost > > How about this. > > #if defined(_BSD_SOURCE) || defined(_GNU_SOURCE) > #define SUN_LEN(s) __sun_len(s) > #endif > > And add __sun_len.c like this. > > #include > #include > > size_t __sun_len(struct sockaddr_un *s) > { > return sizeof(sa_family_t) + strlen(s->sun_path); > } > > I think this solve the problem. No, this is worse. It enlarges libc.so for an interface that's essentially never-used, and more importantly, adds a new symbol to the ABI that we have to keep forever. Rich