[Toybox] bzero(), rindex() and other "legacy" functions

Rob Landley rob at landley.net
Tue Feb 7 19:07:49 PST 2012


On 02/07/2012 08:07 AM, Dmitriy Tochansky wrote:
> 
> 
> 2012/2/7 Rob Landley <rob at landley.net <mailto:rob at landley.net>>
> 
>     memset(blah, 0, sizeof(blah)) is the common case, and not having to say
>     0 is 4 bytes smaller.  Once there are about 3 uses of it, I'd wind up
>     putting a wrapper in lib/lib.c anyway.  Obsoleting that was silly on the
>     part of the standards guys.
> 
>     rindex() is just habit, strrchr() is a gratuitous rename, I don't care
>     either way and can fix that up if it's throwing warnings for you...
> 
> It's not a problem for me, I can fix it myself. The reason of questions
> that I'm writing libc myself and tried to build toybox with it(like it
> built in toybox) and got this warnings(not only :) ). So I asked about
> standards of toybox.

SUSv4, c99, LP64, dubious glances at the Linux man pages, and beyond
that stay simple and wing it.

I note that I may wind up _writing_ a spec for a mount command, because
there isn't one.  I've looked.

> When writing my toy-libc I use "The Open Group Base
> Specifications Issue 7" so this functions is legacy for me. The question
> what standards and codestyle you are guided.

What license is your new library under?

  http://landley.net/notes-2012.html#18-01-2012

> PS I need to read more about bionic internals after your previos letter.
> And maybe about toybox too. :)

Bionic actually looks... almost sane.  Toolbox is a joke but bionic
might be worth extending.  Dunno.

In theory if you clone the android open source project there's a bionic
subdirectory.  That's where I got the copy I was looking at at work.
Alas, the android guys aren't big into DOCUMENTING what they're doing,
so reading the code is pretty much it apparently...

Rob

 1328670469.0


More information about the Toybox mailing list