Subject: Re: new sysctl(KERN_PROC, ...) interface (was: sysinfo(2))
To: None <tech-kern@netbsd.org>
From: Simon Burge <simonb@netbsd.org>
List: tech-kern
Date: 04/18/2000 12:51:49
So, a quick summary of the problems so far:
1) Need a way to read a given va for a process, without resorting to
frobbing vm internals.
Possible solution: add
sysctl(CTL_KERN, KERN_PROC_VA, pid, va, &type, &offset);
2) Need a way to get the address of the ps_strings struct for a given
process - this can vary per process on a machine running both 32 and
64 bit processes.
Possible solutions: add
sysctl(CTL_KERN, KERN_PROC_PSADDR, pid, &va);
or keep address of ps_strings in struct proc and pass back inside
struct kinfo_proc2.
3) Need the size of "char **" for same reasons as 2).
Is there an easy way to tell if a process is a 32 or 64 bit process?
4) Need a way to convert from a machine pointer type to u_int64_t.
Possble solution:
#define PTRTOUINT64(foo) ((u_int64_t)(uintptr_t)(foo))
Is this a reasonable summary? Any better answers than what I have
suggested?
Simon.