#include<stdio.h>
#include<unistd.h>
#include<sys/types.h>
{
pid_t pid;
pid = fork();
if(pid==0)
{
execl("/bin/ls","ls",".",NULL);
perror("execl");
}
if(pid > 0)
{
printf("I am father");
}
if(pid<0)
{
perror("fork");
}
wait();
}
#include<unistd.h>
#include<sys/types.h>
#include<sys/stat.h>
#include<sys/wait.h>
int main(){
pid_t pid;
pid = fork();
if(pid==0)
{
execl("/bin/ls","ls",".",NULL);
perror("execl");
}
if(pid > 0)
{
printf("I am father");
}
if(pid<0)
{
perror("fork");
}
wait();
}