Re: wierd behaviour...

Marc Lehmann (
Wed, 26 Feb 1997 20:57:46 +0100 (MET)

>too complicated tests give wierd results and wrong conclutions... try

You should have tried it..

>and you'll realize that these writes are ~5-10 secs after you start the image.

You SHOULD have tried it.. the writes are instant. run it in a shell-loop,
and your drive light keeps going all the time!

I didn't believe it at first, but:

main(){ pause(); }

compiled, started, and interrupted does nothing (well, after
some time, the atime is updated).. as one would expect.

main(){ fork(); }

on the other hand DOES write to my harddisk, quite loudly, BTW..
this has NOTHING to do with the atime update.

after killing syslogd (maybe some log-file gets written), I still
get the disk-activity...

checked under 2.1.14 (the last one that did compile so far :-)

void main(void) { if(fork()) sleep(2); else sleep(1);}

shows this behavious, while

void main(void) { if(fork()) sleep(1); else sleep(2);}

does not... (except for the atime update, which is much later..)
i.e. if the child dies BEFORE the parent we get the behaviour,
not otherwise round.. (hmm.. I thought it would be
an interatcion with init or the shell, but...)


for a pentium-optimizing gcc, look at

----==-- _
---==---(_)__ __ ____ __ Marc Lehmann
--==---/ / _ \/ // /\ \/ /
-=====/_/_//_/\_,_/ /_/\_\
The choice of a GNU generation