# Process.h

> Mediated Wiki article. Canonical URL: https://mediated.wiki/source/Process.h
> Markdown URL: https://mediated.wiki/source/Process.h.md
> Source: https://en.wikipedia.org/wiki/Process.h
> Source revision: 1345634171
> License: Creative Commons Attribution-ShareAlike 4.0 International (https://creativecommons.org/licenses/by-sa/4.0/)

C header file

**<process.h>** is the C [header file](/source/Header_file) which contains function declarations and macros used in working with threads and processes. Most C compilers that target [DOS](/source/DOS), [Windows 3.1x](/source/Windows_3.1x), [Win32](/source/Win32), [OS/2](/source/OS%2F2), Novell NetWare or [DOS extenders](/source/DOS_extender) supply this header and the library functions in their C library. Neither the header file nor most of the functions are defined by either the [ANSI/ISO C](/source/ANSI_C) standard or by [POSIX](/source/POSIX).

## History

Microsoft's version of the file dates back to at least 1985, according to its copyright statement.[1] An early reference to the file was in a post on the net.micro.pc usenet on Oct-26-1986.[2] The compiler used was [Microsoft C compiler](/source/Microsoft_C_compiler) version 3.0. The [Lattice C](/source/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](/source/Turbo_C) compiler version 2.01. The C Ware-Personal C compiler version 1.2c (June 1989) had only the ANSI headers.

## Functions

Name Description Notes execl, execle, execlp, execlpe load and execute 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. DOS, Win, OS/2 cexit restore interrupt vectors altered by the startup code. DOS, Win, OS/2

## 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 there is no standard on which to base the implementation, the functions declared by process.h differ, depending on the compiler in use. Below is a list of compilers which provide process.h.

- DJGPP[3][4]

- OpenWatcom,[5][6]

- Digital Mars[7][8]

- MinGW[9]

- Microsoft Visual C++[10]

- Borland Turbo C, 2.0 and later[11][12]

- Lcc32[13]

- QNX Neutrino QCC 6.x[14]

## Differences

Another aspect that might vary is the combined length of exec* and spawn* parameters.

- Delorie DJGPP: does not have such a limit.[15]

- 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.[16]

## References

1. **[^](#cite_ref-1)** "Copyright 1985–1989, Microsoft Corporation", in [QuickC](/source/QuickC) version 2.00 process.h file

1. **[^](#cite_ref-msft_process.h_2-0)** [Is my floppy diskette formated?](http://groups-beta.google.com/group/net.micro.pc/browse_frm/thread/b85ef1946a4915e6/1154bb52be4d5854?lnk=st&q=%22process%5C.h%22&rnum=23#1154bb52be4d5854)[*[permanent dead link](https://en.wikipedia.org/wiki/Wikipedia:Link_rot)*], groups-beta.google.com

1. **[^](#cite_ref-3)** [Delorie.com](http://www.delorie.com/djgpp/)

1. **[^](#cite_ref-djgpp_process.h_4-0)** [DJGPP process.h](http://www.delorie.com/djgpp/doc/incs/process.h), delorie.com

1. **[^](#cite_ref-5)** [Openwatcom.org](http://www.openwatcom.org/index.php/Main_Page) [Archived](https://web.archive.org/web/20150317091931/http://www.openwatcom.org/index.php/Main_Page) 2015-03-17 at the [Wayback Machine](/source/Wayback_Machine)

1. **[^](#cite_ref-watcom_clib_6-0)** [OpenWatcom clib](http://www.openwatcom.org/ftp/manuals/clib.pdf) [Archived](https://web.archive.org/web/20061011042009/http://www.openwatcom.org/ftp/manuals/clib.pdf) 2006-10-11 at the [Wayback Machine](/source/Wayback_Machine), openwatcom.org

1. **[^](#cite_ref-7)** [DigitalMars.com](http://www.digitalmars.com/)

1. **[^](#cite_ref-mars_process.h_8-0)** [Digital Mars process.h](http://www.digitalmars.com/rtl/process.html), digitalmars.com

1. **[^](#cite_ref-9)** [MinGW.org](http://www.mingw.org/)

1. **[^](#cite_ref-10)** ["MSDN.Microsoft.com"](https://web.archive.org/web/20070707082306/http://msdn.microsoft.com/vstudio/express/visualc/default.aspx). Archived from [the original](http://msdn.microsoft.com/vstudio/express/visualc/default.aspx) on 2007-07-07. Retrieved 2007-01-15.

1. **[^](#cite_ref-11)** ["Borland.com"](https://web.archive.org/web/20121105211827/http://www.borland.com/). Archived from [the original](http://www.borland.com/) on 2012-11-05. Retrieved 2007-01-15.

1. **[^](#cite_ref-turboc_2.0_12-0)** [C version 2.01](https://archive.today/20110710191522/http://dn.codegear.com/article/20841Turbo), dn.codegear.com

1. **[^](#cite_ref-13)** [CS.Virginia.edu](http://www.cs.virginia.edu/~lcc-win32/)

1. **[^](#cite_ref-14)** [QNX.com](http://www.qnx.com/products/neutrino_rtos/)

1. **[^](#cite_ref-djgpp_spawn_15-0)** [DJGPP spawn*](http://www.delorie.com/djgpp/doc/libc/libc_736.html), delorie.com

1. **[^](#cite_ref-msdn_16-0)** [Microsoft MSDN](http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/HTML/_crt_system.2c_._wsystem.asp), msdn.microsoft.com

## External links

- [Digital Mars _exec reference](http://www.digitalmars.com/rtl/process.html#_exec)

---
Adapted from the Wikipedia article [Process.h](https://en.wikipedia.org/wiki/Process.h) by Wikipedia contributors ([contributor history](https://en.wikipedia.org/wiki/Process.h?action=history)). Available under [Creative Commons Attribution-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/). Changes may have been made.
