Linux - GeneralThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Hello folks ..
am trying to understand ptrace for my project by running few trial program ..
i get this error
unknown escape sequence: '\040'
this is one of those trial programs
/* `tracer' parent */
#include <sys/ptrace.h>
#include <signal.h>
#include <sys/types.h>
#include <sys/wait.h>
main()
{
int pid, status;
if((pid = fork()) == 0) {
execl("/home2/lfy/child1", "child1", 0);
printf("exec failed...\n");
} else {
sleep(1);
kill(pid, SIGINT);
wait(&status); // wait for child to stop
if(WIFSTOPPED(status))
printf("child has stopped...\n");
sleep(3);
ptrace(PTRACE_CONT, pid, 0, 0);
/* Will not come out of this wait because
* child does not terminate.
*/
wait(&status);
}
}
/* compile this program to `child1' */
#include <sys/ptrace.h>
main()
{
ptrace(PTRACE_TRACEME, 0, 0, 0);
while(1) printf("hello\n");
}
I have faced the same issue it is because of your editor version, kindly use vi instead of gedit or vice versa to identify the these special characters.
Eclipse is also a good choice for trying c programming
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.