mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: musl@lists.openwall.com, Florian Weimer <fw@deneb.enyo.de>,
	Norbert Lange <nolange79@gmail.com>
Subject: Re: [musl] [BUG] sysconf implementing _SC_NPROCESSORS_(CONF|ONLN) incorrectly
Date: Wed, 15 Apr 2020 12:01:39 -0400	[thread overview]
Message-ID: <20200415160139.GE11469@brightrain.aerifal.cx> (raw)
In-Reply-To: <20200415100443.GF13749@port70.net>

On Wed, Apr 15, 2020 at 12:04:43PM +0200, Szabolcs Nagy wrote:
> * Norbert Lange <nolange79@gmail.com> [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

  reply	other threads:[~2020-04-15 16:01 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-09 10:29 Norbert Lange
2020-04-09 18:18 ` Szabolcs Nagy
2020-04-09 18:31   ` Florian Weimer
2020-04-10  1:02     ` Rich Felker
2020-04-14 10:08       ` Florian Weimer
2020-04-14 15:55         ` Rich Felker
2020-04-14 16:55           ` Florian Weimer
2020-04-15  9:38             ` Norbert Lange
2020-04-15  9:50               ` Florian Weimer
2020-04-15  9:57                 ` Norbert Lange
2020-04-15 10:04                   ` Szabolcs Nagy
2020-04-15 16:01                     ` Rich Felker [this message]
2020-04-15 15:58                 ` Rich Felker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200415160139.GE11469@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --cc=fw@deneb.enyo.de \
    --cc=musl@lists.openwall.com \
    --cc=nolange79@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).