5 Subprocess Functions

The DEC C Run-Time Library (RTL) provides functions that allow you to create subprocesses from a DEC C program. The creating process is called the parent and the created subprocess is called the child.

To create a child process within the parent process, use the exec functions (execl, execle, execv, execve, execlp, and execvp) and the vfork function. Other functions are available to allow the parent and child to read and write data across processes (pipe) and to allow for synchronization of the two processes (wait). This chapter describes how to implement and use these functions.

The parent process can execute DEC C programs in its children, either synchronously or asynchronously. The number of children that can run simultaneously is determined by the /PRCLM user authorization quota established for each user on your system. Other quotas that may affect the use of subprocesses are /ENQLM (Queue Entry Limit), /ASTLM (AST Waits Limit), and /FILLM (Open File Limit).

This chapter discusses the subprocess functions. Table 5-1 lists and describes all the subprocess functions found in the DEC C RTL. For more detailed information on each function, see the Reference Section.

Table 5-1 Subprocess Functions

Function  Description 
Implementation of Child Processes 
system  Passes a given string to the host environment to be executed by a command processor. 
vfork  Creates an independent child process. 
The exec Functions 
execl, execle, execlp execv, execve, execvp  Passes the name of the image to be activated in a child process. 
Synchronizing Process 
wait, wait3, wait4, waitpid,  Suspends the parent process until a value is returned from a child. 
Interprocess Communication 
pipe  Allows for communication between a parent and child. 


Previous Page | Next Page | Table of Contents | Index