home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / gnu / ixemul-39.47-env-bin.lha / man / cat2 / vfork.0 < prev    next >
Text File  |  1993-12-07  |  2KB  |  67 lines

  1.  
  2. VFORK(2)                   UNIX Programmer's Manual                   VFORK(2)
  3.  
  4. NNAAMMEE
  5.      vvffoorrkk - spawn new process in a virtual memory efficient way
  6.  
  7. SSYYNNOOPPSSIISS
  8.      ##iinncclluuddee <<uunniissttdd..hh>>
  9.  
  10.      _i_n_t
  11.      vvffoorrkk(_v_o_i_d)
  12.  
  13. DDEESSCCRRIIPPTTIIOONN
  14.      VVffoorrkk() can be used to create new processes without fully copying the ad­
  15.      dress space of the old process, which is horrendously inefficient in a
  16.      paged environment.  It is useful when the purpose of fork(2) would have
  17.      been to create a new system context for an execve.  VVffoorrkk() differs from
  18.      fork in that the child borrows the parent's memory and thread of control
  19.      until a call to execve(2) or an exit (either by a call to exit(2) or ab­
  20.      normally.)  The parent process is suspended while the child is using its
  21.      resources.
  22.  
  23.      VVffoorrkk() returns 0 in the child's context and (later) the pid of the child
  24.      in the parent's context.
  25.  
  26.      VVffoorrkk() can normally be used just like fork.  It does not work, however,
  27.      to return while running in the childs context from the procedure that
  28.      called vvffoorrkk() since the eventual return from vvffoorrkk() would then return
  29.      to a no longer existent stack frame.  Be careful, also, to call _exit
  30.      rather than exit if you can't execve,  since exit will flush and close
  31.      standard I/O channels, and thereby mess up the parent processes standard
  32.      I/O data structures.  (Even with fork it is wrong to call exit since
  33.      buffered data would then be flushed twice.)
  34.  
  35. SSEEEE AALLSSOO
  36.      fork(2),  execve(2),  sigvec(2),  wait(2),
  37.  
  38. DDIIAAGGNNOOSSTTIICCSS
  39.      Same as for fork.
  40.  
  41. BBUUGGSS
  42.      This system call will be eliminated when proper system sharing mechanisms
  43.      are implemented.  Users should not depend on the memory sharing semantics
  44.      of vfork as it will, in that case, be made synonymous to fork.
  45.  
  46.      To avoid a possible deadlock situation, processes that are children in
  47.      the middle of a vvffoorrkk() are never sent SIGTTOU or SIGTTIN signals;
  48.      rather, output or ioctl(2) calls are allowed and input attempts result in
  49.      an end­of­file indication.
  50.  
  51. HHIISSTTOORRYY
  52.      The vvffoorrkk function call appeared in 3.0BSD.
  53.  
  54. 4th Berkeley Distribution       March 10, 1991                               1
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.