Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #57860

Re: forking madness

From James Kuyper <jameskuyper@verizon.net>
Newsgroups comp.lang.c
Subject Re: forking madness
Date 2015-03-03 13:57 -0500
Organization Self
Message-ID <54F60417.6010805@verizon.net> (permalink)
References <md2sfm$f67$1@reader1.panix.com> <md4oer$o8u$1@speranza.aioe.org> <878ufe562o.fsf@kst-u.example.com> <md4t6e$4rv$1@speranza.aioe.org>

Show all headers | View raw


On 03/03/2015 01:06 PM, Lőrinczy Zsigmond wrote:
> On 2015.03.03. 18:44, Keith Thompson wrote:> What is the advantage of 
> your (POSIX-only) solution over the standard
>  >
>  >      printf("Your message here\n");
>  >      fflush(stdout);
> 
> Afaik, printf/stdio is allowed to write (or more precisely: write(2)) 
> characters one-by-one, or line-by-line, or all together, or only store 
> until fflush. So printf'd lines may or may not be interleaved.

The C standard allows three buffering modes: none, line buffered, and
fully buffered (7.21.3p3). You mention four possibilities, and I'm not
sure what the last two correspond with.

> (Let's also note that its behavior might be different when writing
> on terminal and when writing into a file.)

"the ... standard output stream [is] fully buffered if and only if the
stream can be determined not to refer to an interactive device." (7.21.3p7).
Therefore it must be either "unbuffered" or "line buffered". Thus,
whatever you meant by the other two options you listed is allowed (if at
all) only if standard output can be determined to not refer to an
interactive device.

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

forking madness Ruben Safir <mrbrklyn@panix.com> - 2015-03-02 23:41 +0000
  Re: forking madness Keith Thompson <kst-u@mib.org> - 2015-03-02 16:05 -0800
    Re: forking madness fir <profesor.fir@gmail.com> - 2015-03-03 01:20 -0800
      Re: forking madness Noob <root@127.0.0.1> - 2015-03-03 15:50 +0100
        Re: forking madness fir <profesor.fir@gmail.com> - 2015-03-03 07:57 -0800
      Re: forking madness Nobody <nobody@nowhere.invalid> - 2015-03-07 07:07 +0000
        Re: forking madness fir <profesor.fir@gmail.com> - 2015-03-07 05:05 -0800
  Re: forking madness Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2015-03-02 19:25 -0500
    Re: forking madness Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2015-03-02 19:32 -0500
    Re: forking madness ruben <nowhere@nowhere.nor> - 2015-03-03 14:56 +0000
      Re: forking madness Keith Thompson <kst-u@mib.org> - 2015-03-03 07:54 -0800
    Re: forking madness asetofsymbols@gmail.com - 2015-03-05 00:03 -0800
      Re: forking madness asetofsymbols@gmail.com - 2015-03-05 00:21 -0800
        Re: forking madness asetofsymbols@gmail.com - 2015-03-05 00:44 -0800
  Re: forking madness Lőrinczy Zsigmond <nospam@for.me> - 2015-03-03 17:45 +0100
    Re: forking madness Keith Thompson <kst-u@mib.org> - 2015-03-03 09:44 -0800
      Re: forking madness Lőrinczy Zsigmond <nospam@for.me> - 2015-03-03 19:06 +0100
        Re: forking madness James Kuyper <jameskuyper@verizon.net> - 2015-03-03 13:57 -0500
          Re: forking madness Lőrinczy Zsigmond <nospam@for.me> - 2015-03-04 06:53 +0100
            Re: forking madness Chad <cdalten@gmail.com> - 2015-03-05 14:09 -0800

csiph-web