LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
LinkBack Search this Thread
Old 03-09-2009, 05:57 AM   #1
jiikka
LQ Newbie
 
Registered: Jan 2009
Location: Chennai, India
Distribution: Redhat
Posts: 23

Rep: Reputation: 16
Question 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");
}
 
Old 03-10-2009, 06:36 AM   #2
GazL
Senior Member
 
Registered: May 2008
Posts: 3,231

Rep: Reputation: 828Reputation: 828Reputation: 828Reputation: 828Reputation: 828Reputation: 828Reputation: 828
Try adding

#include <unistd.h>
 
Old 03-11-2009, 04:58 AM   #3
jiikka
LQ Newbie
 
Registered: Jan 2009
Location: Chennai, India
Distribution: Redhat
Posts: 23

Original Poster
Rep: Reputation: 16
Smile thanks

thanks its working now .. ..
 
  


Reply

Tags
debug


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
warning: incompatible implicit declaration of built-in function ‘bzero’ nasim751 Linux - Software 2 08-08-2011 04:00 PM
'incompatible implicit declaration' errors when compiling -Pb- Linux - Software 6 11-18-2010 12:39 AM
implicit declaration of function error HarryBoy Programming 3 09-11-2008 07:29 AM
warning: incompatible implicit declaration of built-in function ‘exit’ xzotech Programming 1 08-14-2005 05:43 AM
implicit declaration of function 'getdelim' MicahCarrick Programming 2 05-02-2005 11:03 AM


All times are GMT -5. The time now is 07:51 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration