LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
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
 
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: 17
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,380

Rep: Reputation: 912Reputation: 912Reputation: 912Reputation: 912Reputation: 912Reputation: 912Reputation: 912Reputation: 912
Try adding

#include <unistd.h>
 
1 members found this post helpful.
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: 17
Smile thanks

thanks its working now .. ..
 
1 members found this post helpful.
Old 05-07-2014, 03:09 PM   #4
rasobrevilla
LQ Newbie
 
Registered: Jul 2012
Posts: 2

Rep: Reputation: Disabled
Smile Thanks a lot !!

Quote:
Originally Posted by GazL View Post
Try adding

#include <unistd.h>
Thanks a lot, I had the same problem, And this is resolved
 
  


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
warning: incompatible implicit declaration of built-in function ‘bzero’ nasim751 Linux - Software 3 04-21-2014 03:39 AM
'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 04:50 AM.

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