Process.h
Encyclopedia
process.h is a C header file
which contains function declarations and macros used in working with threads and processes. Most C compilers that target DOS
, Windows 3.1x
, Win32, OS/2
, Novell NetWare or DOS extender
s supply this header and the library functions in their C library. Neither the header file nor the functions are defined by either the ANSI/ISO C
standard or by POSIX
.
The Lattice C
compiler version 3.30 (Aug-24-1988) did not have such a header file, but offered similar functions.
Borland provided the header in their Turbo C
compiler version 2.01.
The C Ware-Personal C compiler version 1.2c (June 1989) had only the ANSI headers.
depending on which compiler you use. Below is a list of compilers which provide process.h.
Header file
Some programming languages use header files. These files allow programmers to separate certain elements of a program's source code into reusable files. Header files commonly contain forward declarations of classes, subroutines, variables, and other identifiers...
which contains function declarations and macros used in working with threads and processes. Most C compilers that target DOS
DOS
DOS, short for "Disk Operating System", is an acronym for several closely related operating systems that dominated the IBM PC compatible market between 1981 and 1995, or until about 2000 if one includes the partially DOS-based Microsoft Windows versions 95, 98, and Millennium Edition.Related...
, Windows 3.1x
Windows 3.1x
Windows 3.1x is a series of 16-bit operating systems produced by Microsoft for use on personal computers. The series began with Windows 3.1, which was first sold during March 1992 as a successor to Windows 3.0...
, Win32, OS/2
OS/2
OS/2 is a computer operating system, initially created by Microsoft and IBM, then later developed by IBM exclusively. The name stands for "Operating System/2," because it was introduced as part of the same generation change release as IBM's "Personal System/2 " line of second-generation personal...
, Novell NetWare or DOS extender
DOS extender
A DOS extender is a computer software program which enables software to run under a protected mode environment even though the host operating system is only capable of operating in real mode....
s supply this header and the library functions in their C library. Neither the header file nor the functions are defined by either the ANSI/ISO C
ANSI C
ANSI C refers to the family of successive standards published by the American National Standards Institute for the C programming language. Software developers writing in C are encouraged to conform to the standards, as doing so aids portability between compilers.-History and outlook:The first...
standard or by POSIX
POSIX
POSIX , an acronym for "Portable Operating System Interface", is a family of standards specified by the IEEE for maintaining compatibility between operating systems...
.
History
Microsoft’s version of the file dates back to at least 1985, according to its copyright statement. An early reference to the file was in a post on the net.micro.pc usenet on Oct-26-1986. The compiler used was Microsoft C compiler version 3.0.The Lattice C
Lattice C
Lattice C was the first C compiler for MS-DOS on the IBM PC, in 1982. It was ported to many other platforms, such as mainframes , minicomputers , workstations , OS/2, the Commodore Amiga, Atari ST and the Sinclair QL.The compiler was subsequently repackaged by Microsoft under a distribution...
compiler version 3.30 (Aug-24-1988) did not have such a header file, but offered similar functions.
Borland provided the header in their Turbo C
Turbo C
Turbo C is an Integrated Development Environment and compiler for the C programming language from Borland. First introduced in 1987, it was noted for its integrated development environment, small size, extremely fast compile speed, comprehensive manuals and low price.In May 1990, Borland replaced...
compiler version 2.01.
The C Ware-Personal C compiler version 1.2c (June 1989) had only the ANSI headers.
Member functions
Name | Description | Notes |
---|---|---|
execl, execle, execlp, execlpe |
load and execute Execution (computers) Execution in computer and software engineering is the process by which a computer or a virtual machine carries out the instructions of a computer program. The instructions in the program trigger sequences of simple actions on the executing machine... a new child process by placing it in memory previously occupied by the parent process. Parameters are passed individually. |
DOS,Win,OS/2,POSIX |
execv, execve, execvp, execvpe |
load and execute a new child process by placing it in memory previously occupied by the parent process. Parameters are passed as an array of pointers. | DOS,Win,OS/2,POSIX |
spawnl, spawnle, spawnlp, spawnlpe |
load and execute a new child process. Parameters are passed individually. | DOS,Win,OS/2 |
spawnv, spawnve, spawnvp, spawnvpe |
load and execute a new child process. Parameters are passed as an array of pointers. | DOS,Win,OS/2 |
beginthread, beginthreadNT |
creates a new thread of execution within the current process. | Win,OS/2 |
endthread |
terminates a thread created by beginthread . |
Win,OS/2 |
getpid |
returns the process identifier Process identifier In computing, the process identifier is a number used by most operating system kernels to uniquely identify a process... . |
DOS,Win,OS/2 |
cexit |
restore interrupt vectors altered by the startup code. | DOS,Win,OS/2 |
Member constants
Name | Description | Notes | OS |
---|---|---|---|
_P_WAIT |
Suspends parent process until the child process has finished executing. | synchronous spawn. | MS-DOS,Win32,OS/2 |
_P_NOWAIT, _P_NOWAITO |
Continues to execute calling process concurrently with new process. | asynchronous spawn. | Win32,OS/2 |
_P_OVERLAY |
Overlays parent process with child, which destroys the parent. | has the same effect as the exec* functions. |
MS-DOS,Win32,OS/2 |
_P_DETACH |
The child is run in background without access to the console or keyboard. | Calls to _cwait upon the new process will fail. Asynchronous spawn. |
Win32,OS/2 |
_WAIT_CHILD |
used as cwait action. |
Obsolete on Win32. | MS-DOS,OS/2 |
_WAIT_GRANDCHILD |
used as cwait action. |
Obsolete on Win32. | MS-DOS,OS/2 |
Implementations
Given the fact that there is no standard on which to base the implementation, the functions declared by process.h differs,depending on which compiler you use. Below is a list of compilers which provide process.h.
- DJGPP
- OpenWatcom,
- Digital Mars
- MinGW
- Microsoft Visual C++
- Borland Turbo C, 2.0 and later
- Lcc32
- QNX Neutrino QCC 6.x
Differences
Another aspect that might vary is the combined length of exec* and spawn* parameters.- Delorie DJGPP : does not have such a limit.
- Digital Mars : the maximum is 128 bytes; nothing is stated about the ending '\0' character.
- Microsoft cl : the argument list for the new process must not exceed 1024 bytes.