Subject: Re: ps_strings addrress (was: new sysctl(KERN_PROC, ...) interface)
To: None <tech-kern@netbsd.org>
From: Simon Burge <simonb@netbsd.org>
List: tech-kern
Date: 04/24/2000 00:52:27
Simon Burge wrote:

> [[ finding ps_strings ]]
>
> Given games with structure packing, it may be easier to return
> the individual components of ps_strings rather than let userland make a
> guess - it may be possible to have a 64 bit processor that's happy to
> have 4 byte alignment in structures.

After looking, I don't think that passing the individual components of
ps_strings can work - there's nothing to stop a program from saying

	char **myargv;
	...
	argv = myargv;

so we really need to know the address of ps_strings, not it's contents.
To solve any structure packing problems, perhaps for each process the
address of ps_strings as well as the offsets of each component can
be stored.  These can then be filled in by the exec handler for that
process.  This combined with the knowledge of kernel pointer size and
program pointer size should handle any combination.

Does this sound workable, of have I completed confused the compat32
issues?

Simon.