What is the behavioral difference between signal(SIGCHLD,SIG_IGN) and signal(SIGCHLD,SIG_DFL)?
If we replace signal(SIGCHLD,SIG_IGN) with signal(SIGCHLD,SIG_DFL), What can be the impact?
Will it craete a Zombie process?

According to man 7 signal the default action for SIGCHLD is to ignore the signal so SIG_IGN and SIG_DFL seem to invoke the same bahavior. However, there is a stipulation earlier in the text that states:

   A child created via fork(2) inherits a copy of its parent's signal dis‐
   positions.   During  an  execve(2), the dispositions of handled signals
   are reset to the default; the dispositions of ignored signals are  left
   unchanged.

See man 7 signal and man 2 signal for more details.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.