Hi...

On Thu, Dec 9, 2010 at 21:56, loody <milo...@gmail.com> wrote:
> Deal all:
> I have some questions about times in #include <sys/times.h>.
> As far as I know, times will "get process and waited-for child process
> times".
> so if the child is not finish or dead, this function will cause the
> deadlock, right?

>From "man 2 times"
" In Linux kernel versions before 2.6.9, if the disposition of SIGCHLD is
       set  to SIG_IGN then the times of terminated children are automatically
       included in the tms_cstime and tms_cutime fields, although POSIX.1-2001
       says that this should only happen if the calling process wait()s on its
       children.  This non-conformance is rectified in Linux 2.6.9 and  later"

So, indirectly, I think the time accumulation happens when the wait()
function returns...which is...I guess polling or regularly checking
(select() maybe?) the signal from child.

-- 
regards,

Mulyadi Santosa
Freelance Linux trainer and consultant

blog: the-hydra.blogspot.com
training: mulyaditraining.blogspot.com

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecar...@nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ

Reply via email to