#include #include #include int main() { pit_t pid; /* for a child process */ pid = fork(); if ( pid < 0 ) { /* fork failed */ fprintf( stderr, "Fork failed" ); exit( -1 ); } else if ( pid == 0 ) { /* This is child process */ execlp( "/bin/ls", "ls", NULL ); } else { /* this is parent process */ wait( NULL ); printf( "child complete" ); exit( 0 ); } }