It's unexplainable...

YANG Liqun yang at nff.ncl.omron.co.jp
Fri Feb 1 12:45:38 AEST 1991


In profesor at wpi.WPI.EDU (Matthew E Cross)'s arctile he writes:
>In article <peterj.665303644 at zeus> peterj at swanee.ee.uwa.oz.au (Peter Jones) writes:
>>>In <1991Jan30.203605.14481 at bronze.ucs.indiana.edu>
>> speelmo at bronze.ucs.indiana.edu (Lance Speelmon - UCS) writes:
>> ...
>>>Would anyone please explain to me why my output is not what I am expecting...

>> There are two processes running here, one is the "foo" program and the
>>other is the "date" program.  It will depend on the scheduling what actually
>>happens - I guess.  It would need "foo" to either flush its output buffer
>>or to do an input or to write to "stderr" (& not be buffered).

>No,no, no. Well, OK, ...

>Also, the "date" program prints a newline before it prints the date.

Yes, "date" does print a newline. But if it did not print a newline what would
be ? Suppose system calls a command does not print a newline. I think the
result will be the same.
The key point here is that a process exits it will automatically close all
the files opened and "close" will flush the buffer.
Yang

--
;  Li-qun Yang			OMRON Computer Technology R&D lab
;  yang at nff.ncl.omron.co.jp	tel: 075-951-5111  fax: 075-956-7403



More information about the Comp.lang.c mailing list