From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: (qmail 13096 invoked from network); 15 Apr 2020 16:01:54 -0000 Received-SPF: pass (mother.openwall.net: domain of lists.openwall.com designates 195.42.179.200 as permitted sender) receiver=inbox.vuxu.org; client-ip=195.42.179.200 envelope-from= Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with UTF8ESMTPZ; 15 Apr 2020 16:01:54 -0000 Received: (qmail 5510 invoked by uid 550); 15 Apr 2020 16:01:52 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 5491 invoked from network); 15 Apr 2020 16:01:51 -0000 Date: Wed, 15 Apr 2020 12:01:39 -0400 From: Rich Felker To: musl@lists.openwall.com, Florian Weimer , Norbert Lange Message-ID: <20200415160139.GE11469@brightrain.aerifal.cx> References: <20200409181824.GD13749@port70.net> <87r1wwik8t.fsf@mid.deneb.enyo.de> <20200410010255.GN11469@brightrain.aerifal.cx> <877dyinzuz.fsf@mid.deneb.enyo.de> <20200414155522.GB11469@brightrain.aerifal.cx> <87wo6iknx1.fsf@mid.deneb.enyo.de> <87o8rtjcwj.fsf@mid.deneb.enyo.de> <20200415100443.GF13749@port70.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200415100443.GF13749@port70.net> User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [musl] [BUG] sysconf implementing _SC_NPROCESSORS_(CONF|ONLN) incorrectly On Wed, Apr 15, 2020 at 12:04:43PM +0200, Szabolcs Nagy wrote: > * Norbert Lange [2020-04-15 11:57:16 +0200]: > > I can't comment on whether glibc should be emulated. The point I am trying > > to make is that it might be better to let the compilation fail by default, > > or not provide the function at all. > > > > The implementation right now doesn't seem sufficient (to put it midly) and > > it prevents detection and automatic fallbacks. For example trace-cmd would > > do this, and would work nicely - but instead it will gets musls > > implementation that's defeated by setting an affinity mask. > > the point is that the glibc implementation is not sufficient either. > > you don't get what you think you get as a result so you better off > to just always do the fallback. > > identifying musl via a macro would be extremely bad in this case > since we are discussing to change the implementation and the > macro would not reflect that so a wrong default would be baked > into the source (which shows why it is a good idea not to provide > such a macro at all: most developers dont understand how to use > such macros and by now there would be a lot of broken musl > workarounds that are not relevant to the latest musl version). Note that this could be represented by the sort of macro exposure I want to propose on libc-coord: not __MUSL__ but something like _EXT_SC_...NPROC_REFLECTS_RESOURCE_CONSTRAINTS. Of course then it would document a specific permanent (without redefining the _SC_* macros to different values for a new one) behavior, so this may not be a good choice. As a worst case the behavior could be documented to the application via another sysconf variable. :-P Rich