TEXT   23

.fork.txt

Guest on 1st August 2021 05:48:22 PM

  1. FORK(2)                    Linux Programmer Manual                   FORK(2)
  2.  
  3.  
  4.  
  5. NAME
  6.        fork - create a child process
  7.  
  8. SYNOPSIS
  9.        #include <sys/types.h>
  10.        #include <unistd.h>
  11.  
  12.        pid_t fork(void);
  13.  
  14. DESCRIPTION
  15.        fork  creates a child process that differs from the parent process only
  16.        in its PID and PPID, and in the fact that resource utilizations are set
  17.        to 0.  File locks and pending signals are not inherited.
  18.  
  19.        Under Linux, fork is implemented using copy-on-write pages, so the only
  20.        penalty incurred by fork is the time and memory required  to  duplicate
  21.        the parent page tables, and to create a unique task structure for the
  22.        child.
  23.  
  24. RETURN VALUE
  25.        On success, the PID of the child process is returned  in  the  parent
  26.        thread  of execution, and a 0 is returned in the child thread of exe-
  27.        cution.  On failure, a -1 will be returned in the parent context,  no
  28.        child process will be created, and _____ will be set appropriately.
  29.  
  30. ERRORS
  31.        EAGAIN fork cannot allocate sufficient memory to copy the parent page
  32.               tables and allocate a task structure for the child.
  33.  
  34.        ENOMEM fork failed to allocate the necessary kernel structures  because
  35.               memory is tight.
  36.  
  37. CONFORMING TO
  38.        The fork call conforms to SVr4, SVID, POSIX, X/OPEN, BSD 4.3.
  39.  
  40. SEE ALSO
  41.        clone(2), execve(2), vfork(2), wait(2)
  42.  
  43.  
  44.  
  45. Linux 1.2.9                                                  FORK(2)

Raw Paste


Login or Register to edit or fork this paste. It's free.