[PATCH] Process adoption (2.4.9 sched.h/fork.c/exit.c)

From: Peter Lister (P.Lister@sychron.com)
Date: Tue Sep 11 2001 - 14:36:17 EST


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



- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Sep 15 2001 - 21:00:34 EST