Subject: Re: kernel printf() return type
To: Frank van der Linden <fvdl@wasabisystems.com>
From: Jaromir Dolecek <jdolecek@netbsd.org>
List: tech-kern
Date: 12/09/2002 11:12:08
I think the reason why it returns void is that nothing really
uses the return value and it saves an instruction or two.
Frank van der Linden wrote:
> Is there any reason that the kernel version of printf has return type
> void? The return value (number of characters printed) is readily
> available from kprintf() (the internal version). Changing it to
> return an int would also make it have matching semantics with
> userspace, and with FreeBSD, amongst others.
>
> Originally, the kernel printf was indeed void, but we've had an
> int-returning kprintf since subr_prf.c rev 1.45:
>
> date: 1997/10/24 18:14:25; author: chuck; state: Exp; lines: +841 -467
> import chris torek's vfprintf() from libc [renamed to kprintf and all
> floating point stuff removed].
>
> If noone objects, I'll make the trivial change in a couple of days.
>
> - Frank
>
> --
> Frank van der Linden fvdl@wasabisystems.com
> ==============================================================================
> Quality NetBSD Development, Support & Service. http://www.wasabisystems.com/
>
--
Jaromir Dolecek <jdolecek@NetBSD.org> http://www.NetBSD.org/
-=- We should be mindful of the potential goal, but as the tantric -=-
-=- Buddhist masters say, ``You may notice during meditation that you -=-
-=- sometimes levitate or glow. Do not let this distract you.'' -=-