The macro PVPROCPTR(pid) can convert PID to Process pointer.
so I use it. But there is a error when I make it.
1>ld : 0711-317 error : Undefined symbol: pvproc
1> ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
And the definition of this macro in AIX header file is as follow:
extern struct pvproc pvproc[NPROC]; /* the process table, itself */
/* convert pid to proc pointer */
#define PVPROCPTR(pid) (&pvproc[PROCMASK(pid)])
So I want to know why can't it be used?
The question is "why". So:
pvproc is an internal kernel structure. If you are making a kernel extension, then what you have might be able to work. I don't see it exported from any of the *exp files in /usr/lib so it is appears that it is not intended to work from anywhere but from within the kernel itself.
I would expect AIX would provide a kernel service to do what you want rather than a macro. A kernel service has more stability across different versions of AIX (but it can still change -- just not as often).
Lets step back for a second and ask a bigger question: why do you want the pvproc structure? (Well... first, answer: is this a kernel extension?)