From owner-freebsd-hackers Thu Jan 15 13:49:06 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id NAA14624 for hackers-outgoing; Thu, 15 Jan 1998 13:49:06 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from smtp04.primenet.com (smtp04.primenet.com [206.165.6.134]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id NAA14611 for ; Thu, 15 Jan 1998 13:48:55 -0800 (PST) (envelope-from tlambert@usr01.primenet.com) Received: (from daemon@localhost) by smtp04.primenet.com (8.8.8/8.8.8) id OAA05039; Thu, 15 Jan 1998 14:48:46 -0700 (MST) Received: from usr01.primenet.com(206.165.6.201) via SMTP by smtp04.primenet.com, id smtpd005018; Thu Jan 15 14:48:43 1998 Received: (from tlambert@localhost) by usr01.primenet.com (8.8.5/8.8.5) id OAA25166; Thu, 15 Jan 1998 14:48:41 -0700 (MST) From: Terry Lambert Message-Id: <199801152148.OAA25166@usr01.primenet.com> Subject: Re: session id gets dropped To: proett@nas.nasa.gov Date: Thu, 15 Jan 1998 21:48:41 +0000 (GMT) Cc: freebsd-hackers@FreeBSD.ORG In-Reply-To: <199801132323.PAA23244@tailspin.nas.nasa.gov> from "Tom Proett" at Jan 13, 98 03:23:37 pm X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk > I am working with a batch system that uses the POSIX session to keep track > of which processes comprise a "job". Under FreeBSD, I use kvm_getprocs() > to get information for all the proceses then use kvm_read() to read > the session structure for each process (pointed to by kp_eproc.e_sess). > It turns out that the s_leader field in the session structure becomes > NULL if the session leader exits. Why is there no s_sid field in the > session structure to use as a session id even if the leader is gone? > Even better would be for this to be replicated in the kp_eproc struct > in kinfo_proc like e_ppid, e_pgid, etc. > > If nobody thinks it's a bad idea, I will look into making the change. If you are going to go to this much trougly, you should go the rest of the way and expose the value via procfs so your code will be immune to needing to be recompiled if the structure changes. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers.