lkml.org 
[lkml]   [1997]   [Feb]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: wierd behaviour...
Date
>       hi, i compile a c program
>
> main(){ fork();} /* no while to do several fork(). so its safe */
> /* no danger for your computer */
>
> so when i run it, my harddrive is running. Even if i run it several times
> to be sure sure that the code is in buffers. i don't understand why my
> hd need to write or read something during or after this little program.
>
> any explaination ?

some answers me by email to suggest it is a atime update but i don't think
so. because "main(){}" doesn't read/write anything. any other classic
unix tools like ls, ping etc... don't read/write anything immediatly on
my hd...

i studied vmstat's io bo ("bo: Blocks received from a block device (blocks/s)"
from vmstat's manpage) and i see 4 new bo each time i run my source.

that comes from fork(), and the following source makes me think something
these 4 blocks is read when the child die.
main(){ if( !fork()) sleep(4); else sleep(2); }

any explaination ?

--
Jerome Etienne <jetienne at ifhamy.insa-lyon.fr> aim: being human, not ape
aim: Learn the core knowledge and deduce from it and the current context.
Thou shalt not make a machine in the likeness of a human mind. --- f.herbert

\
 
 \ /
  Last update: 2005-03-22 13:39    [W:0.036 / U:0.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site