Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm 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 Message-ID: <4271E5C6.876A373D@dessent.net> Date: Fri, 29 Apr 2005 00:44:06 -0700 From: Brian Dessent MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: Help understanding process tree References: <4270F2F5 DOT 5010000 AT agilent DOT com> <20050428150258 DOT GB13295 AT trixie DOT casa DOT cgf DOT cx> <20050429072631 DOT GC3112 AT efn DOT org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Reply-To: cygwin AT cygwin DOT com Yitzchak Scott-Thoennes wrote: > > Right. cmd is a non-cygwin program so it needs a cygwin stub to handle > > being "execed". sleep is a cygwin program and does not require any > > hand holding. > > Now go back and reread the sentence where he says "I'd like help > understanding why..." :) I was under the impression that the reason that Cygwin processes often appear as orphans and not part of the process tree (from the standpoint of a native win32 app that is) is due to supporting exec(). AFAIK there is no direct way in the win32 API to replace a process with another, so in order to exec() the parent must create a new process and then itself exit - thus leaving the child with no parent process. This is also the reason why Cygwin must maintain its own PID translation table, since the above process results in the exec()'d process with a new PID. But exec() is supposed to replace a process, and not change its PID, so Cygwin has to invent the notion of Cygwin PIDs that can differ from Windows PIDs. I could be off in my understanding of the above, however. To the original poster... Try "procps aux --forest" if you want an accurate picture of the Cygwin process tree, since procps is a Cygwin program and thus will use Cygwin PIDs. Brian -- 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/