EmbLogic's Blog

EXEC family….

fd = open(“1.txt”,O_CREAT|O_RDONLY);
fd1 = open(“2.txt”,O_CREAT|O_RDONLY);
pid_t p;
p = fork();
if (p == 0)
{
printf(“entering into child process\n”);
execl(“./test”,”test”,fd,fd1,NULL);
}
else
{
printf(“this is parent\n”);
}
return 0;

DOUBT:- the execl statement is not being executed….the program is getting terminated without its execution…can anyone help me wid this……

One Response to EXEC family….

  1. fd and fd1 are integers n u r trying to pass them as strings…
    first convert them into strings and then try..

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>