lkml.org 
[lkml]   [2002]   [Aug]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch] printk from userspace
On Tue, Aug 13, 2002 at 09:44:14PM -0700, Linus Torvalds wrote:
> Actually, anybody who uses stdio on syslog messages should be roasted.
> Over the nice romantic glow of red-hot coal, slowly cooking the stupid git
> alive.

If you're logging huge messages, sure, that's just plain Stupid. But for
messages that are smaller than the size of the stdio buffer an fprintf()
followed by fflush() gets a single atomic write for most values of libc.

> It's not a bug, it's a feature. A syslog message needs to be atomic, which
> means that it MUST NOT use the buffering of stdio.

And that's why we have write(2) on file descriptors. Having write(2)
in the form of syslog(2) makes no sense. It adds to the mass of abi
that needs to be maintained. Making the mechanism of writing using the
existing infrastructure doesn't increase the size of the ABI.

-ben
--
"You will be reincarnated as a toad; and you will be much happier."
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:28    [W:0.090 / U:0.272 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site