why?

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?
 
V

Victor Bazarov

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?

Most likely it's because there declaration of 'getprocs' is not in any of
the headers you included.

Since 'getprocs' is not a standard C++ function, we cannot help you any
further on the matter. You need to post your question to an AIX
newsgroup.

V
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top