According to my purpose, I just want to let my process be running in the background. Then I could write normal program and run it with the following command: nohup myprogram 1>2 2>/dev/null &
Then this program will be running in the background, just like as a daemon.
With this way, I do not need to call fork() for running in background. So my question is what is the difference to run program in background with the above command between using fork() function?