lkml.org 
[lkml]   [1999]   [Mar]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectexecl!
Have a look at this piece of code.
The instructions prior to the execl() function is not getting executed.
When I give a getchar() after the printf statement then the "Tr -module"
is getting printed.
From the manpage, what I had understood is that the execl function
replaces the current process image with the new process image.
But, Does it replaces the prior instructions also? or what is happening??

int pid;
pid = fork();
if (pid == 0)
{
printf("Tr -module");
getchar();
execl("/sbin/insmod", "insmod", "trc", NULL);
}
else if (pid < 0)
perror("Error in fork - load2.c");
else
{
printf("I am in the parent process");

}







-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:50    [W:0.070 / U:0.280 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site