From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=48487 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P4VyK-0007c0-3P for qemu-devel@nongnu.org; Sat, 09 Oct 2010 05:44:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P4VyI-0005t9-S3 for qemu-devel@nongnu.org; Sat, 09 Oct 2010 05:44:07 -0400 Received: from mail-qy0-f180.google.com ([209.85.216.180]:48909) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P4VyI-0005t3-Ps for qemu-devel@nongnu.org; Sat, 09 Oct 2010 05:44:06 -0400 Received: by qyk1 with SMTP id 1so1787022qyk.4 for ; Sat, 09 Oct 2010 02:44:06 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <1286470548-7518-1-git-send-email-weil@mail.berlios.de> References: <1286470548-7518-1-git-send-email-weil@mail.berlios.de> From: Blue Swirl Date: Sat, 9 Oct 2010 09:43:45 +0000 Message-ID: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] Re: [PATCH] win32: Set unbuffered stdout List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Weil Cc: QEMU Developers Thanks, applied. On Thu, Oct 7, 2010 at 4:55 PM, Stefan Weil wrote: > Win32 does not support line-buffering, but it allows > unbuffered output. > > Unbuffered output is a good approximation. For typical output > statements which usually end with '\n', it's even identical. > > Buffered output is unusable for program traces because of > its large delay. > > Cc: Blue Swirl > Signed-off-by: Stefan Weil > --- > =C2=A0os-win32.c =C2=A0 =C2=A0 =C2=A0| =C2=A0 =C2=A06 ++++++ > =C2=A0qemu-os-win32.h | =C2=A0 =C2=A03 +-- > =C2=A02 files changed, 7 insertions(+), 2 deletions(-) > > diff --git a/os-win32.c b/os-win32.c > index dd46bf4..3c6f50f 100644 > --- a/os-win32.c > +++ b/os-win32.c > @@ -221,6 +221,12 @@ char *os_find_datadir(const char *argv0) > =C2=A0 =C2=A0 return NULL; > =C2=A0} > > +void os_set_line_buffering(void) > +{ > + =C2=A0 =C2=A0setbuf(stdout, NULL); > + =C2=A0 =C2=A0setbuf(stderr, NULL); > +} > + > =C2=A0/* > =C2=A0* Parse OS specific command line options. > =C2=A0* return 0 if option handled, -1 otherwise > diff --git a/qemu-os-win32.h b/qemu-os-win32.h > index 2ff9f45..c63778d 100644 > --- a/qemu-os-win32.h > +++ b/qemu-os-win32.h > @@ -45,8 +45,7 @@ void os_host_main_loop_wait(int *timeout); > =C2=A0static inline void os_setup_signal_handling(void) {} > =C2=A0static inline void os_daemonize(void) {} > =C2=A0static inline void os_setup_post(void) {} > -/* Win32 doesn't support line-buffering and requires size >=3D 2 */ > -static inline void os_set_line_buffering(void) {} > +void os_set_line_buffering(void); > =C2=A0static inline void os_set_proc_name(const char *dummy) {} > > =C2=A0#if !defined(EPROTONOSUPPORT) > -- > 1.7.1 > >