G
Guest
i wirte a code in aix.
#include <stdio.h>
#include <stdlib.h>
#include <procinfo.h>
#include <string.h>
int main ( int argc , char ** argv )
{
struct procsinfo pi;
pid_t retval = (pid_t) 0;
while(getprocs(&pi, sizeof pi, 0, 0,&retval, 1)>0)
{
if ( strstr ( pi.pi_comm , argv[1] ) )
{
printf ( "\npi.pi_comm := %s\n" , pi.pi_comm );
printf ( "pid := %d\n" , pi.pi_pid );
printf ( "ppid := %d\n" , pi.pi_ppid );
printf ( "pi_size := %d\n" , pi.pi_size );
printf ( "pi_nice := %d\n" , pi.pi_nice );
printf ( "pi_state := %d\n" , pi.pi_state );
printf ( "pi_flags := %d\n" , pi.pi_flags );
printf ( "pi_utime := %d\n" , pi.pi_utime );
printf ( "pi_stime := %d\n" , pi.pi_stime );
}
}
}
when i compiler it :
xlC -c pinfo.cpp
"pinfo.cpp", line 11.15: 1540-0274 (S) The name lookup for "getprocs" did
not find a declaration.
why?
#include <stdio.h>
#include <stdlib.h>
#include <procinfo.h>
#include <string.h>
int main ( int argc , char ** argv )
{
struct procsinfo pi;
pid_t retval = (pid_t) 0;
while(getprocs(&pi, sizeof pi, 0, 0,&retval, 1)>0)
{
if ( strstr ( pi.pi_comm , argv[1] ) )
{
printf ( "\npi.pi_comm := %s\n" , pi.pi_comm );
printf ( "pid := %d\n" , pi.pi_pid );
printf ( "ppid := %d\n" , pi.pi_ppid );
printf ( "pi_size := %d\n" , pi.pi_size );
printf ( "pi_nice := %d\n" , pi.pi_nice );
printf ( "pi_state := %d\n" , pi.pi_state );
printf ( "pi_flags := %d\n" , pi.pi_flags );
printf ( "pi_utime := %d\n" , pi.pi_utime );
printf ( "pi_stime := %d\n" , pi.pi_stime );
}
}
}
when i compiler it :
xlC -c pinfo.cpp
"pinfo.cpp", line 11.15: 1540-0274 (S) The name lookup for "getprocs" did
not find a declaration.
why?