[Toybox] getconf NPROCESSORS_ONLN broken

enh enh at google.com
Fri Sep 28 20:05:11 PDT 2018


As someone who has a vested interest in having less generated code (because
I'd like to stop checking in generated files and use toybox in the AOSP
build[1])... do we even need to do this? How many of these defines are
missing on glibc/musl/bionic? If it's only one or two as I assume, could we
just have the #ifdefs instead?

Or are there actually a large number of these missing?

___
1. The real problem for me there is that I don't want to replicate all your
scripts in the AOSP build system, but I do want to do the equivalent work.
If it were just the help and flags, I'd probably swallow it --- the library
availability is something I can hard code anyway. But random stuff like
this is something I'd much rather avoid...

On Fri, Sep 28, 2018, 14:41 enh <enh at google.com> wrote:

> $ ./toybox getconf NPROCESSORS_CONF NPROCESSORS_ONLN
> 48
> 2097152
>
> seems like this isn't working:
>
>   # Extract names, remove blank lines, filter, replace unknown #defines
>   # with UNKNOWN
>   sed -n "/char [*]${1}_names[[]/"',/^}/s/[^"]*"\([^"]*\) *",*/\1\n/pg' \
>     toys/posix/getconf.c | grep -v '^$' | $2 |
>     sed -e "$DEFINES" -e "t;d;a UNKNOWN" | xargs | tr ' ' ',' &&
>   echo '};'
>
> glibc doesn't have an _XOPEN_UUCP but instead of the promised UNKNOWN,
> everything after that is just off-by-one...
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20180928/80a90a02/attachment-0001.htm>


More information about the Toybox mailing list