#include <unistd.h>
#include <stdlib.h>

int main() {
  printf("Processes before the exec() call:\n");
  system("ps -f");
  
  /*    FILE TO EXECUTE   COMMAND  ARGUMENTS    */
  execl("/usr/bin/emacs", "emacs", NULL);
  
  /* should never get here, unless execl() returned with an error */
  perror("execl()");
  exit(1);
}
