incompatible implicit declaration of built-in function ‘execl’ ? ? ?
Hello folks ..
am trying to understand ptrace for my project by running few trial program ..
i get this error
incompatible implicit declaration of built-in function ‘execl’
this is one of those trial programs
#include <sys/ptrace.h>
#include <signal.h>
#include <sys/types.h>
#include <sys/wait.h>
main()
{
int pid, status;
if((pid = fork()) == 0) {
ptrace(PTRACE_TRACEME, 0, 0, 0);
execl("/home2/lfy/child2", "child2", 0);
printf("exec failed...\n");
} else {
wait(&status);
if(WIFSTOPPED(status))
printf("child has stopped...\n");
sleep(10);
ptrace(PTRACE_CONT, pid, 0, 0);
wait(&status);
}
}
//compile into `child2'
main()
{
printf("child starts...\n");
sleep(1);
while(1) printf("hello\n");
}
|