home *** CD-ROM | disk | FTP | other *** search
/ GEMini Atari / GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso / files / gnu / libsrc87 / vfork.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-07-30  |  797 b   |  38 lines

  1. /*
  2.  * fork(), vfork(): emulate Unix calls. fork() creates a new process with
  3.  * identical (but *not* shared) data space; vfork() does the same, but
  4.  * shares data and stack with the parent. Note that, unlike Unix, the
  5.  * parent is suspended until the child exits. Also note that fork() is
  6.  * usable only if _initial_stack is non-zero, so that the process is
  7.  * doing malloc's from the heap.
  8.  *
  9.  * wait() retrieves the exit status and pid of children created by
  10.  * fork.
  11.  *
  12.  * see fork.c for _fork() and _wait().
  13.  *
  14.  * written by Eric R. Smith and placed in the public domain.
  15.  * use at your own risk.
  16.  */
  17.  
  18. #include "fork.h"
  19.  
  20. int fork()
  21. {
  22.     return _fork((char *)0);
  23. }
  24.  
  25. int
  26. vfork(dummy)
  27. int dummy;
  28. {
  29.     return _fork((char *)&dummy);
  30. }
  31.  
  32. int
  33. wait(exit_code)
  34. int *exit_code;
  35. {
  36.     return _wait(exit_code);
  37. }
  38.