vfork()
suspends the parent until the child either calls exec*()
or _exit()
.
using vfork()
in this format as we use fork()
results in program run in infinite loop. it doesn't end.
read this discussion to get better idea about using vfork()
.