busybox-1.3.0 and nonstd APIs, installment 2

Denis Vlasenko vda.linux at googlemail.com
Tue Dec 19 22:20:34 UTC 2006


On Tuesday 19 December 2006 22:13, Bernhard Fischer wrote:
> On Tue, Dec 19, 2006 at 09:35:41PM +0100, Denis Vlasenko wrote:
> >On Tuesday 19 December 2006 01:27, sampo at symlabs.com wrote:
> >> Denis Vlasenko writes:
> >> > On Monday 18 December 2006 07:09, sampo at symlabs.com wrote:
> >> >> 2. Replace use of nonstandard fdprintf() with busybox's built-in
> >> >>   full_write(). The fdprintf() under dietlibc() apparently
> >> >>   gets somehow aliased to dprintf() which is equally bad. glibc
> >> >>   man page provides long explanation why dprintf() is a historical
> >> >>   error and should not be used. Neither fdprintf() nor dprintf()
> >> >>   is compliant with any known standard. 
> >> > 
> >> > But it is neat. Does attached patch work for you?
> >> 
> >> It would be neat if it was standard. 
> >> 
> >> I am not convinced about why you are trying to patch in
> >> an implementation of dprintf() when I supplied you
> >> a perfectly good patch that elimitated the dprintf()
> >> dependency entirely from the busybox. Try (after my patch) 
> >> 
> >> busybox-1.3.0 0$ grep -r dprintf . 
> >> 
> >> and you see the entire need for dprintf() has been eliminated.
> >
> >The goal of the project is to be _small_.
> >It means "use fdprintf() where it makes code smaller,
> >and provide fdprintf() for libc's where it is missing"
> 
> I beg to disagree since i personally detest fdprintf and dprintf,
> likewise.

Well, I do not love them, but I do not feel offended by them either.
They are non-standard, yes. Is it a sin? No.

For example, out xasprintf is non-standard. Is it evil? NO.
It is atrociously beautiful. Swiss army knife of string
manipulation tool for C :)

I see it like this: we want to have a function which printf's
to file descriptor, without need for explicit intermediate buffer.
We can implement it ourself, like we did for xasprintf.
But it happens so that glibc and uclibc alredy have one, so we use
that.

If you really don't like it, please explain why it is evil.
"Non-standard" isn't evil enough (at least for me).
--
vda



More information about the busybox mailing list