function fork_test ()
  pid = fork ();
  if (pid != 0)
    printf ("waiting for child process %d…", pid);
    fflush (stdout);
    [~, sts] = waitpid (pid);
    printf (" done: %d\n", WEXITSTATUS (sts));
  else
    pause (3);
    exit (3);
  endif
endfunction
