function fork49109 ()
  pid = fork ();
  if (pid == 0)
    fprintf (stderr, "[%d] process started\n", getpid ());
    fprintf (stderr, "[%d] process exiting\n", getpid ());
    exit (0);
  elseif (pid > 0)
    [~, status] = waitpid (pid);
    if (WIFEXITED (status))
      fprintf (stderr, "[%d] returned with exit status %d\n", pid, WEXITSTATUS (status));
    elseif (WIFSIGNALED (status))
      fprintf (stderr, "[%d] killed with signal %d\n", pid, WTERMSIG (status));
    endif
  endif
endfunction
