#include <cstdio>
#include <cstdlib>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
int main()
{
pid_t pid;
pid = fork();
if (pid< 0)
{
/* error occurred */
fprintf(stderr, "Fork Failed");
exit(-1);
}
else if (pid == 0)
{ /* child process */
execlp("/bin/ls", "ls", NULL);
exit(0);
}
else
{ /* parent process */ /* parent will wait for the child to complete */
//wait(NULL);
printf("Child Complete\n");
exit(0);
}
printf("hello from OS_0!\n");
return 0;
}