# You need EOF on input... system("nohup program /dev/null 2>&1 &"); # You need 1 line of empty input... system("/bin/echo | nohup program >/dev/null 2>&1 &"); # You need infinite lines of empty input system("yes '' | nohup program >/dev/null 2>&1 &");