From owner-freebsd-hackers Fri Nov 10 3:17:40 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from spammie.svbug.com (mg136-070.ricochet.net [204.179.136.70]) by hub.freebsd.org (Postfix) with ESMTP id 1E2FC37B479; Fri, 10 Nov 2000 03:17:34 -0800 (PST) Received: from spammie.svbug.com (localhost.mozie.org [127.0.0.1]) by spammie.svbug.com (8.9.3/8.9.3) with ESMTP id DAA01311; Fri, 10 Nov 2000 03:17:32 -0800 (PST) (envelope-from jessem@spammie.svbug.com) Message-Id: <200011101117.DAA01311@spammie.svbug.com> Date: Fri, 10 Nov 2000 03:17:31 -0800 (PST) From: opentrax@email.com Reply-To: opentrax@email.com Subject: Re: printf() To: msmith@FreeBSD.ORG Cc: bright@wintelcom.net, duan@cs.umn.edu, freebsd-hackers@FreeBSD.ORG In-Reply-To: <200011101034.eAAAYk906022@mass.osd.bsdi.com> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On 10 Nov, Mike Smith wrote: >> >> Does the kernel function printf() flushes the output immediately, or it is >> >> possible some data is buffered somewhere and gets lost without printing >> >> to the console? like the corresponding funtion in the c library. >> > >> > It's not buffered afaik. >> > >> Actually my experince in writing drivers (for 386bsd) showed (me) >> that the kernel printf() was buffered. > > Considerable (ie. shitloads) of experience using the kernel printf with > FreeBSD (not to mention reading the code line by line as I ported it for > libstand) allows me to tell you that it isn't. > > And you're welcome to go read the code yourself, should you choose to > take issue with that. 8) > Sir, with regards to your experience and reading of the code, I should say that as you have read it, that would appear to be the situation. Better judgement - and testing to see how it might be buffered - would seem to be a challange. However, before we quest into what might be a futile battle on the definition of a word. Let's first agree that taken the code at face value you are correct. I will certainly not deny - code taken on face value to be code taken on value. Let us also agree that "buffering" might be defined in different ways. For instance, we could say, "buffering implies an actual level of intermediate storage that might (for some unknown reason) be delaying the output of a printf()" Show that be the case, then it would stem that our differences are minor, and could simply be a difference in interpetation or meaning of the word "buffered". As such, let me NOT blather on with meaningless dribble. Let us say, if we might, that there could be a delay in output two (2) seperate kernel printf() statements. Or said an other way, Is it possible for two (2) printf() statements NOT to be outputed in a linear fashinon? Ie. the first printf() statement get printed first, the second - second. If we differ on this point, then perhaps a example might be needed. As such, my example would only work under 386BSD, as I stated. Being your stated experience with FreeBSD, it is quite possible that I am incorrect. Should that be the case, then I stand correct. However, I see no evidence to such. Further my understanding or *BSD kernels, could be skewed, but past experience tells me otherwise. Is there is way that I could perhaps demonstrate my reasoning, such that it might be satisfactory to you? best regards, Jessem. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message