home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / mint / mntdoc01.zoo / mintdoc / cat3 / fork.3 < prev    next >
Encoding:
Text File  |  1993-03-03  |  1.5 KB  |  67 lines

  1.  
  2.  
  3.  
  4. FORK(3)             MINTLIB LIBRARY FUNCTIONS             FORK(3)
  5.  
  6.  
  7. N✓NA✓AM✓ME✓E
  8.        fork - create a new process
  9.  
  10. S✓SY✓YN✓NO✓OP✓PS✓SI✓IS✓S
  11.        #include <unistd.h>
  12.  
  13.        int fork(void);
  14.  
  15. D✓DE✓ES✓SC✓CR✓RI✓IP✓PT✓TI✓IO✓ON✓N
  16.        fork  creates  a  copy of the current process using Pfork.
  17.        This call splits the program  into  two  copies,  both  of
  18.        which continue to run. The only difference between the two
  19.        is the returned value. In  one  of  these  processes,  the
  20.        child,  this is zero. In the other, the parent, it is non-
  21.        zero; it is the process ID of the child (a  positive  num-
  22.        ber), or a negative error code if the call failed.
  23.  
  24. S✓SE✓EE✓E A✓AL✓LS✓SO✓O
  25.        e✓ex✓xe✓ec✓c.✓..✓.(✓(3✓3)✓),✓, t✓tf✓fo✓or✓rk✓k(✓(3✓3)✓),✓, v✓vf✓fo✓or✓rk✓k(✓(3✓3)✓),✓, w✓wa✓ai✓it✓t(✓(3✓3)✓)
  26.  
  27. N✓NO✓OT✓TE✓ES✓S
  28.        At  the  moment (MiNT 0.99 and earlier), Pfork, and conse-
  29.        quently also fork, suspends the parent until the child has
  30.        terminated  or  overlays itself. This has yet to be fixed,
  31.        and may cause problems when porting UN*X programs.
  32.  
  33.        There are various intricate differences between the parent
  34.        and  the child process, like the effects of closing a file
  35.        on which a lock has been obtained  (the  parent  owns  the
  36.        locks).  You  are advised to check the man pages for Pfork
  37.        and Pvfork, in addition to  the  kernel  sources,  if  you
  38.        really want to know.
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64. MiNT docs 0.1              3 March 1993                         1
  65.  
  66.  
  67.