By "foreground" do you mean "terminal control"? If so, Hko is correct. Beware, though, that the session leader needs to make the tcsetpgrp call. If the process that wants terminal control places the call, that process will pause with SIGTTOU unless handled or blocked. If it's handled or blocked you will get an error and won't receive control. Do you know how to create a session leader and make sure it controls a terminal?
ta0kira
|