compiler can't find pstatus_t even procfs.h inlcuded

Hi,
I am trying to get a the process cpu usage from the /proc file recently, on the Solaris 5.10. But met some rookie issue which i need some help. for below program, compiler complains that pstatus_t is undefined, although both type are defined in the procfs.h.

\#include <sys/procfs.h>

int main\(\)
\{
    struct pstatus *pstatus_p;
    pstatus_t *pstatus_p2;
\}

Errors as below:
$ cc pstatus.c
"pstatus.c", line 6: undefined symbol: pstatus_t
"pstatus.c", line 6: undefined symbol: pstatus_p
cc: acomp failed for pstatus.c

$ gcc pstatus.c
In file included from /nfs/other/prod_solaris/wh/dtd/sparc-SunOS5/gcc/3.4.3/bin/../lib/gcc/sparc-sun-solaris2.8/3.4.3/include/sys/signal.h:44,
from /usr/include/sys/old_procfs.h:28,
from /usr/include/sys/procfs.h:29,
from pstatus.c:1:
/usr/include/sys/siginfo.h:259: error: parse error before "ctid_t"
/usr/include/sys/siginfo.h:292: error: parse error before '}' token
/usr/include/sys/siginfo.h:294: error: parse error before '}' token
/usr/include/sys/siginfo.h:390: error: parse error before "ctid_t"
/usr/include/sys/siginfo.h:398: error: conflicting types for '__fault'
/usr/include/sys/siginfo.h:267: error: previous declaration of '__fault' was here
/usr/include/sys/siginfo.h:404: error: conflicting types for '__file'
/usr/include/sys/siginfo.h:273: error: previous declaration of '__file' was here
/usr/include/sys/siginfo.h:420: error: conflicting types for '__prof'
/usr/include/sys/siginfo.h:287: error: previous declaration of '__prof' was here
/usr/include/sys/siginfo.h:424: error: conflicting types for '__rctl'
/usr/include/sys/siginfo.h:291: error: previous declaration of '__rctl' was here
/usr/include/sys/siginfo.h:426: error: parse error before '}' token
/usr/include/sys/siginfo.h:428: error: parse error before '}' token
/usr/include/sys/siginfo.h:432: error: parse error before "k_siginfo_t"
/usr/include/sys/siginfo.h:437: error: parse error before '}' token
In file included from /usr/include/sys/old_procfs.h:28,
from /usr/include/sys/procfs.h:29,
from pstatus.c:1:

I can sure that the cc and gcc works fine with other programs. Would you please take a look at this issue and provide your suggestion. Thanks in adv.

got some more information: even i commented out the include line, the compiler won't complain with the first line, i.e. "struct pstatus *pstatus_p;".
I suppose it is mean that the files does not be included at all. But the file is right under the /usr/include/sys directory.

Anyone knows why? or how should i investigate it more?

seems that
cd /usr/local/lib/gcc-lib/sparc-sun-solaris2.10/3.3.2/install-tools
../mkheaders

can fix the gcc issue.

[freetds] Make error on Solaris 10

Looks like the following may be your problem with the procfs header:

#if !defined(_KERNEL) && _STRUCTURED_PROC == 0
#include <sys/old_procfs.h>
#else   /* !defined(_KERNEL) && _STRUCTURED_PROC == 0 */
.....
#endif

Thanks Murphy.
Do you mean that the old_procfs.h file raises the issue? Could you please present it a little more detail?

Sorry for responsing a little bit late