LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux > Linux - General
User Name
Password
Linux - General This 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

Tags used in this thread
Popular LQ Tags

Reply
 
Thread Tools
Old 03-09-2009, 06:57 AM   #1
jiikka
LQ Newbie
 
Registered: Jan 2009
Location: Chennai, India
Distribution: Redhat
Posts: 23
Thanked: 1
Question incompatible implicit declaration of built-in function ‘execl’ ? ? ?


[Log in to get rid of this advertisement]
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");
}
jiikka is offline  
Tag This Post
Reply With Quote
Old 03-10-2009, 07:36 AM   #2
GazL
Member
 
Registered: May 2008
Location: England.
Posts: 880
Thanked: 78
Try adding

#include <unistd.h>
GazL is offline     Reply With Quote
Old 03-11-2009, 05:58 AM   #3
jiikka
LQ Newbie
 
Registered: Jan 2009
Location: Chennai, India
Distribution: Redhat
Posts: 23
Thanked: 1

Original Poster
Smile thanks

thanks its working now .. ..
jiikka is offline     Reply With Quote

Reply

Bookmarks


Thread Tools

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
implicit declaration of function error HarryBoy Programming 3 09-11-2008 08:29 AM
warning: incompatible implicit declaration of built-in function ‘bzero’ nasim751 Linux - Software 1 04-16-2008 03:35 AM
'incompatible implicit declaration' errors when compiling -Pb- Linux - Software 5 11-15-2007 06:50 AM
warning: incompatible implicit declaration of built-in function ‘exit’ xzotech Programming 1 08-14-2005 06:43 AM
implicit declaration of function 'getdelim' MicahCarrick Programming 2 05-02-2005 12:03 PM


All times are GMT -5. The time now is 10:15 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
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration