"Return value in the master process is always 0"
You mixed that up. Return value in the original process ("master") is the PID of the new process, the new process gets 0 as return value.
Yeah. You are right. I mixed up example code and blindly continued description based on it :D Thanks. Post Updated.
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.