www.delorie.com/gnu/docs/glibc/libc_563.html   search  
 
Buy the book!


The GNU C Library

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

26. Processes

Processes are the primitive units for allocation of system resources. Each process has its own address space and (usually) one thread of control. A process executes a program; you can have multiple processes executing the same program, but each process has its own copy of the program within its own address space and executes it independently of the other copies.

Processes are organized hierarchically. Each process has a parent process which explicitly arranged to create it. The processes created by a given parent are called its child processes. A child inherits many of its attributes from the parent process.

This chapter describes how a program can create, terminate, and control child processes. Actually, there are three distinct operations involved: creating a new child process, causing the new process to execute a program, and coordinating the completion of the child process with the original program.

The system function provides a simple, portable mechanism for running another program; it does all three steps automatically. If you need more control over the details of how this is done, you can use the primitive functions to do each step individually instead.

26.1 Running a Command  The easy way to run another program.
26.2 Process Creation Concepts  An overview of the hard way to do it.
26.3 Process Identification  How to get the process ID of a process.
26.4 Creating a Process  How to fork a child process.
26.5 Executing a File  How to make a process execute another program.
26.6 Process Completion  How to tell when a child process has completed.
26.7 Process Completion Status  How to interpret the status value returned from a child process.
26.8 BSD Process Wait Functions  More functions, for backward compatibility.
26.9 Process Creation Example  A complete example program.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

  webmaster   donations   bookstore     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003