Mon Sep 3 02:32:00 GMT 2007
On Mon, 3 Sep 2007, d.henman wrote:
> Corinna in the following message, specified a way, ie. use setsid(), to dissociate a tty from a process.
> I ust want to ask if this is still the preferred method, or if any newer method exists?
IIRC the setsid () call's purpose is to identify a process later on, and
it allows the option of obtaining the process id from either the process
that started the background process, or any processes it might begin while
in the background.
To detach completely from a terminal, programs normally fork twice - after
the first fork (), the process closes stdin, stdout, and stderr, again,
IIRC, and then, a second fork () launches the actual process, completely,
detached from the terminal I/O channels, after the process begun by the
first fork () terminates.
At least, that's one technique, but it's worked for me.
Ctalk Home Page: http://ctalk-lang.sourceforge.net
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
More information about the Cygwin