X-Spam-Check-By: sourceware.org Date: Sun, 2 Sep 2007 21:28:23 -0400 (EDT) From: Robert Kiesling To: "d.henman" cc: cygwin AT cygwin DOT com Subject: Re: tty dissociation In-Reply-To: <20070903074852.3148@blackhawk> Message-ID: References: <20070903074852 DOT 3148 AT blackhawk> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-ELNK-Trace: 0b901cbc512a9d8594f5150ab1c16ac0c864d17e3813b99a18f75b30c0a4c4ccd7b6a1d6d834f523350badd9bab72f9c350badd9bab72f9c350badd9bab72f9c Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com 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. > > http://sourceware.org/ml/cygwin/2001-08/msg00753.html > > > 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. Regards, Robert Kiesling Ctalk Home Page: http://ctalk-lang.sourceforge.net -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/