qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Lionel Landwerlin <lionel.landwerlin@openwide.fr>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] flush stdout after printing usage()
Date: Wed, 28 Jan 2009 22:51:25 +0100	[thread overview]
Message-ID: <1233179485.6716.7.camel@cocoduo.atr> (raw)
In-Reply-To: <20090128210639.GB4155@kos.to>

Le mercredi 28 janvier 2009 à 23:06 +0200, Riku Voipio a écrit :
> On Wed, Jan 28, 2009 at 02:10:42PM -0600, Anthony Liguori wrote:
> > Riku Voipio wrote:
> > >testcase:
> > >
> > >qemu-arm|grep cpu
> > >
> > >Without fflush() getting output from piped qemu is a bit random.
> 
> > It should get flushed upon exit(). Perhaps the problem is that we're 
> > using _exit() instead of exit()?
> 

_exit does not trigger callbacks registred with at_exit.

from the man page :

       The function _exit() is like exit(3), but does not call  any  functions
       registered  with  atexit(3) or on_exit(3).  Whether it flushes standard
       I/O buffers and removes temporary  files  created  with  tmpfile(3)  is
       implementation-dependent.   On  the other hand, _exit() does close open
       file descriptors, and this may cause  an  unknown  delay,  waiting  for
       pending  output to finish.  If the delay is undesired, it may be useful
       to call functions like tcflush(3) before calling _exit().  Whether  any
       pending  I/O  is  canceled,  and which pending I/O may be canceled upon
       _exit(), is implementation-dependent.

  reply	other threads:[~2009-01-28 21:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-28 18:47 [Qemu-devel] [PATCH] flush stdout after printing usage() Riku Voipio
2009-01-28 20:10 ` Anthony Liguori
2009-01-28 21:06   ` Riku Voipio
2009-01-28 21:51     ` Lionel Landwerlin [this message]
2009-01-28 22:00       ` Anthony Liguori
2009-02-06 14:33         ` Riku Voipio

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1233179485.6716.7.camel@cocoduo.atr \
    --to=lionel.landwerlin@openwide.fr \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).