Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 15 Jan 1998 21:48:41 +0000 (GMT)
From:      Terry Lambert <tlambert@primenet.com>
To:        proett@nas.nasa.gov
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: session id gets dropped
Message-ID:  <199801152148.OAA25166@usr01.primenet.com>
In-Reply-To: <199801132323.PAA23244@tailspin.nas.nasa.gov> from "Tom Proett" at Jan 13, 98 03:23:37 pm

next in thread | previous in thread | raw e-mail | index | archive | help
> 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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199801152148.OAA25166>