From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Tue, 11 Sep 2001 15:36:35 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Tue, 11 Sep 2001 15:36:18 -0400 Received: from no-dns-yet.demon.co.uk ([62.49.236.27]:5625 "EHLO big-guy.sychron.com") by vger.kernel.org with ESMTP id ; Tue, 11 Sep 2001 15:36:03 -0400 X-Mailer: exmh version 2.0.3 To: linux-kernel@vger.kernel.org Cc: P.Lister@sychron.com Cc: Alan Cox Reply-to: Peter Lister Subject: [PATCH] Process adoption (2.4.9 sched.h/fork.c/exit.c) Mime-Version: 1.0 Content-Type: multipart/mixed ; boundary="==_Exmh_9514203340" Date: Tue, 11 Sep 2001 20:36:17 +0100 From: Peter Lister Message-Id: Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org This is a multipart MIME message. --==_Exmh_9514203340 Content-Type: text/plain; charset=us-ascii I attach a patch against 2.4.9 which implements process adoption. This seems to be of general use; as searches of the kernel-traffic archives have not thrown up anything similar, we'd like to contribute it. As noted in http://www.tux.org/lkml/#s1-19, I'm cc'ing Alan Cox; just now we're more interested in feedback from Alan and the list than immediate acceptance by Linus. Should this prompt anyone to contribute a better solution that Alan or Linus prefers, we're happy as long as it fixes the daemon tracking problem. Useful feedback welcome: I'm sure there are problems; please be gentle with a newbie contributor. :) Functionality is similar to Solaris process lineage "orphan" fields, though the terminology is changed, as noted in the patch to sched.h, simply because the list includes processes which are NOT orphans. There is no tainting by Solaris code - none of the authors have ever had access to Solaris source. Sychron uses this patch in kernels to support modules that track process trees; primarily to find the grandparent of a daemon process, since this is a common case which is hampered by the traditional behaviour that the parent pid becomes 1 (init). With this patch, we can find who started the original process. The existing parent pid logic is unchanged. Before anyone comments - yes, I *do* know that there is no way to export this information to user space. So far we haven't need to. -- Peter Lister, Sychron Inc. - 1-866-SYCHRON Intelligent Infrastructure - www.sychron.com --==_Exmh_9514203340 Content-Type: text/plain; name="patch.adoption"; charset=us-ascii Content-Description: patch.adoption Content-Transfer-Encoding: x-uuencode Content-Disposition: attachment; filename="patch.adoption" begin 644 patch.adoption M26YD97@Z(&QI;G5X+T1O8W5M96YT871I;VXO0V]N9FEG=7)E+FAE;'`*/3T] M/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T] M/3T]/3T]/3T]/3T]/3T]/3T]/0I20U,@9FEL93H@+W5S97)S+W-Y8VAR;VXO M8W9S"]$;V-U;65N=&%T:6]N+T-O;F9I9W5R92YH96QP+'8* M7-T96T*("`@&ETF4Z($%P<&QE5&%L:RP@171H97)N970L($1/ M4RP@1$U!+"!&050L($944"P@26YT97)N970L(`I);F1E>#H@;&EN=7@O87)C M:"]I,S@V+V-O;F9I9RYI;@H]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T] M/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]"E)#4R!F M:6QE.B`O=7-E"]A"]I;F-L=61E M+VQI;G5X+W-C:&5D+F@*/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T] M/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/0I20U,@9FEL M93H@+W5S97)S+W-Y8VAR;VXO8W9S"]I;F-L=61E+VQI;G5X M+W-C:&5D+F@L=@IR971R:65V:6YG(')E=FES:6]N(#$N,2XR+C8*"]I;F-L=61E+VQI;G5X+W-C:&5D+F@) M,C`P,2\P."\Q-B`Q.#HS-SHR,0DQ+C$N,BXV"BLK*R!L:6YU>"]I;F-L=61E M+VQI;G5X+W-C:&5D+F@),C`P,2\P."\R-"`Q-3HR.3HR-`DQ+C$N,BXV+C(N M,0I`0"`M-#`Q+#8@*S0P,2PV,"!`0`H@("`@"74S,B!S96QF7V5X96-?:60[ M"B`O*B!0'0@061O M<'1E9"!3:6)L:6Y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