<!DOCTYPE html>
<html class="client-js"><head>
  <meta charset="UTF-8">
  <title>process.h</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <script>
    function importScript() { return 1 } // this is to avoid the error from site.js
  </script>
  <script>let articleId = 'Process.h'</script>
  <link rel="canonical" href="https://en.wikipedia.org/wiki/Process.h">
  <link href="../-/mw/ext.cite.ux-enhancements.css" rel="stylesheet" type="text/css">
<link href="../-/mw/ext.cite.styles.css" rel="stylesheet" type="text/css">
<link href="../-/mw/skins.minerva.base.reset|skins.minerva.content.styles|ext.cite.style|site.styles|mobile.app.pagestyles.android|mediawiki.page.gallery.styles|mediawiki.skinning.content.parsoid.css" rel="stylesheet" type="text/css">
  <link href="../-/style.css" rel="stylesheet" type="text/css"><link href="../-/content.parsoid.css" rel="stylesheet" type="text/css"><link href="../-/inserted_style.css" rel="stylesheet" type="text/css">
  <script src="../-/script.js"></script><script src="../-/masonry.min.js"></script><script src="../-/article_list_home.js"></script><script src="../-/images_loaded.min.js"></script><script src="../-/node_module/details-element-polyfill/dist/details-element-polyfill.js"></script>
</head>

<body class="mediawiki mw-hide-empty-elt ns-0 ns-subject stable skin-minerva action-view animations">
  <div id="mw-mf-viewport" class="feature-header-v2">
    <div id="mw-mf-page-center">
      <div id="content" class="mw-body">
        <a id="top"></a>
        <div id="bodyContent" class="content mw-parser-output">
          
          <div id="mw-content-text" style="direction: ltr;"><h1 class="section-heading" tabindex="0" aria-haspopup="true" data-section-id="0">
  <span class="mw-headline" id="title_0">process.h</span>
</h1>
<div id="mf-section-0" class="mf-section-0" aria-pressed="true" aria-expanded="true">
  <p><span>
</span><meta property="mw:PageProp/displaytitle" content="process.h">
<b>process.h</b> is a C <a href="Header_file" title="Header file" class="mw-redirect">header file</a> which contains function declarations and macros used in working with threads and processes. Most C compilers that target <a href="DOS" title="DOS">DOS</a>, <a href="Windows_3.1x" title="Windows 3.1x">Windows 3.1x</a>, Win32, <a href="OS/2" title="OS/2">OS/2</a>, Novell NetWare or <a href="DOS_extender" title="DOS extender">DOS extenders</a> 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 <a href="ANSI_C" title="ANSI C">ANSI/ISO C</a> standard or by <a href="POSIX" title="POSIX">POSIX</a>.</p>


</div><details data-level="2" open="">
    <summary class="section-heading"><h2 id="History">History</h2></summary>
    
<p>Microsoft's version of the file dates back to at least 1985, according to its copyright statement.<span class="mw-ref reference" id="cite_ref-1"><a href="#cite_note-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></span> An early reference to the file was in a post on the net.micro.pc usenet on Oct-26-1986.<span class="mw-ref reference" id="cite_ref-msft_process.h_2-0"><a href="#cite_note-msft_process.h-2" style="counter-reset: mw-Ref 2;"><span class="mw-reflink-text">[2]</span></a></span> The compiler used was Microsoft C compiler version 3.0.
The <a href="Lattice_C" title="Lattice C">Lattice C</a> compiler version 3.30 (Aug-24-1988) did not have such a header file, but offered similar functions.
Borland provided the header in their <a href="Turbo_C" title="Turbo C" class="mw-redirect">Turbo C</a> compiler version 2.01.
The C Ware-Personal C compiler version 1.2c (June 1989) had only the ANSI headers.</p>


    
</details><details data-level="2" open="">
    <summary class="section-heading"><h2 id="Member_functions">Member functions</h2></summary>
    
<table class="wikitable">
<tbody><tr>
<th>Name</th><th>Description</th><th>Notes</th></tr>
<tr>
<td><code><a href="Exec_(operating_system)" title="Exec (operating system)" class="mw-redirect">execl, execle, execlp, execlpe</a></code></td><td>load and execute a new child process by placing it in memory previously occupied by the parent process. Parameters are passed individually.</td><td>DOS,Win,OS/2,POSIX</td></tr>
<tr>
<td><code><a href="Exec_(operating_system)" title="Exec (operating system)" class="mw-redirect">execv, execve, execvp, execvpe</a></code></td><td>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.</td><td>DOS,Win,OS/2,POSIX</td></tr>
<tr>
<td><code><a href="Spawn_(computing)" title="Spawn (computing)">spawnl, spawnle, spawnlp, spawnlpe</a></code></td><td>load and execute a new child process. Parameters are passed individually.</td><td>DOS,Win,OS/2</td></tr>
<tr>
<td><code><a href="Spawn_(computing)" title="Spawn (computing)">spawnv, spawnve, spawnvp, spawnvpe</a></code></td><td>load and execute a new child process. Parameters are passed as an array of pointers.</td><td>DOS,Win,OS/2</td></tr>
<tr>
<td><code><a href="Beginthread" title="Beginthread">beginthread, beginthreadNT</a></code></td><td>creates a new thread of execution within the current process.</td><td>Win,OS/2</td></tr>
<tr>
<td><code><span class="new">endthread</span></code></td><td>terminates a thread created by <code>beginthread</code>.</td><td>Win,OS/2</td></tr>
<tr>
<td><code><a href="Getpid" title="Getpid" class="mw-redirect">getpid</a></code></td><td>returns the <a href="Process_identifier" title="Process identifier">process identifier</a>.</td><td>DOS,Win,OS/2</td></tr>
<tr>
<td><code><span class="new">cexit</span></code></td><td>restore interrupt vectors altered by the startup code.</td><td>DOS,Win,OS/2</td></tr>
<tr class="mw-empty-elt"></tr>
</tbody></table>


    
</details><details data-level="2" open="">
    <summary class="section-heading"><h2 id="Member_constants">Member constants</h2></summary>
    
<table class="wikitable">
<tbody><tr>
<th>Name</th><th>Description</th><th>Notes</th><th>OS</th></tr>
<tr>
<td><code>_P_WAIT</code></td><td>Suspends parent process until the child process has finished executing.</td><td>synchronous spawn.</td><td>MS-DOS,Win32,OS/2</td></tr>
<tr>
<td><code>_P_NOWAIT, _P_NOWAITO</code></td><td>Continues to execute calling process concurrently with new process.</td><td>asynchronous spawn.</td><td>Win32,OS/2</td></tr>
<tr>
<td><code>_P_OVERLAY</code></td><td>Overlays parent process with child, which destroys the parent.</td><td>has the same effect as the <code>exec*</code> functions.</td><td>MS-DOS,Win32,OS/2</td></tr>
<tr>
<td><code>_P_DETACH</code></td><td>The child is run in background without access to the console or keyboard.</td><td>Calls to <code>_cwait</code> upon the new process will fail. Asynchronous spawn.</td><td>Win32,OS/2</td></tr>
<tr>
<td><code>_WAIT_CHILD</code></td><td>used as <code>cwait</code> action.</td><td>Obsolete on Win32.</td><td>MS-DOS,OS/2</td></tr>
<tr>
<td><code>_WAIT_GRANDCHILD</code></td><td>used as <code>cwait</code> action.</td><td>Obsolete on Win32.</td><td>MS-DOS,OS/2</td></tr>
</tbody></table>


    
</details><details data-level="2" open="">
    <summary class="section-heading"><h2 id="Implementations">Implementations</h2></summary>
    
<p>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.</p>

<ul><li>DJGPP<span class="mw-ref reference" id="cite_ref-3"><a href="#cite_note-3" style="counter-reset: mw-Ref 3;"><span class="mw-reflink-text">[3]</span></a></span><span class="mw-ref reference" id="cite_ref-djgpp_process.h_4-0"><a href="#cite_note-djgpp_process.h-4" style="counter-reset: mw-Ref 4;"><span class="mw-reflink-text">[4]</span></a></span></li>
<li>OpenWatcom,<span class="mw-ref reference" id="cite_ref-5"><a href="#cite_note-5" style="counter-reset: mw-Ref 5;"><span class="mw-reflink-text">[5]</span></a></span><span class="mw-ref reference" id="cite_ref-watcom_clib_6-0"><a href="#cite_note-watcom_clib-6" style="counter-reset: mw-Ref 6;"><span class="mw-reflink-text">[6]</span></a></span></li>
<li>Digital Mars<span class="mw-ref reference" id="cite_ref-7"><a href="#cite_note-7" style="counter-reset: mw-Ref 7;"><span class="mw-reflink-text">[7]</span></a></span><span class="mw-ref reference" id="cite_ref-mars_process.h_8-0"><a href="#cite_note-mars_process.h-8" style="counter-reset: mw-Ref 8;"><span class="mw-reflink-text">[8]</span></a></span></li>
<li>MinGW<span class="mw-ref reference" id="cite_ref-9"><a href="#cite_note-9" style="counter-reset: mw-Ref 9;"><span class="mw-reflink-text">[9]</span></a></span></li>
<li>Microsoft Visual C++<span class="mw-ref reference" id="cite_ref-10"><a href="#cite_note-10" style="counter-reset: mw-Ref 10;"><span class="mw-reflink-text">[10]</span></a></span></li>
<li>Borland Turbo C, 2.0 and later<span class="mw-ref reference" id="cite_ref-11"><a href="#cite_note-11" style="counter-reset: mw-Ref 11;"><span class="mw-reflink-text">[11]</span></a></span><span class="mw-ref reference" id="cite_ref-turboc_2.0_12-0"><a href="#cite_note-turboc_2.0-12" style="counter-reset: mw-Ref 12;"><span class="mw-reflink-text">[12]</span></a></span></li>
<li>Lcc32<span class="mw-ref reference" id="cite_ref-13"><a href="#cite_note-13" style="counter-reset: mw-Ref 13;"><span class="mw-reflink-text">[13]</span></a></span></li>
<li>QNX Neutrino QCC 6.x<span class="mw-ref reference" id="cite_ref-14"><a href="#cite_note-14" style="counter-reset: mw-Ref 14;"><span class="mw-reflink-text">[14]</span></a></span></li></ul>


    
</details><details data-level="2" open="">
    <summary class="section-heading"><h2 id="Differences">Differences</h2></summary>
    
<p>Another aspect that might vary is the combined length of exec* and spawn* parameters.</p>
<ul><li>Delorie DJGPP: does not have such a limit.<span class="mw-ref reference" id="cite_ref-djgpp_spawn_15-0"><a href="#cite_note-djgpp_spawn-15" style="counter-reset: mw-Ref 15;"><span class="mw-reflink-text">[15]</span></a></span></li>
<li>Digital Mars: the maximum is 128 bytes; nothing is stated about the ending '\0' character.</li>
<li>Microsoft cl: the argument list for the new process must not exceed 1024 bytes.<span class="mw-ref reference" id="cite_ref-msdn_16-0"><a href="#cite_note-msdn-16" style="counter-reset: mw-Ref 16;"><span class="mw-reflink-text">[16]</span></a></span></li></ul>


    
</details><details data-level="2" open="">
    <summary class="section-heading"><h2 id="References">References</h2></summary>
    
<div class="mw-references-wrap mw-references-columns"><ol class="mw-references references"><li id="cite_note-1"> <span id="mw-reference-text-cite_note-1" class="mw-reference-text">"Copyright 1985–1989, Microsoft Corporation", in <a href="QuickC" title="QuickC">QuickC</a> version 2.00 process.h file</span></li><li id="cite_note-msft_process.h-2"> <span id="mw-reference-text-cite_note-msft_process.h-2" class="mw-reference-text"><a href="http://groups-beta.google.com/group/net.micro.pc/browse_frm/thread/b85ef1946a4915e6/1154bb52be4d5854?lnk=st&amp;q=%22process%5C.h%22&amp;rnum=23#1154bb52be4d5854" class="external text external">Is my floppy diskette formated?</a>, groups-beta.google.com</span></li><li id="cite_note-3"> <span id="mw-reference-text-cite_note-3" class="mw-reference-text"><a href="http://www.delorie.com/djgpp/" class="external text external">Delorie.com</a></span></li><li id="cite_note-djgpp_process.h-4"> <span id="mw-reference-text-cite_note-djgpp_process.h-4" class="mw-reference-text"><a href="http://www.delorie.com/djgpp/doc/incs/process.h" class="external text external">DJGPP process.h</a>, delorie.com</span></li><li id="cite_note-5"> <span id="mw-reference-text-cite_note-5" class="mw-reference-text"><a href="http://www.openwatcom.org/index.php/Main_Page" class="external text external">Openwatcom.org</a> <a href="https://web.archive.org/web/20150317091931/http://www.openwatcom.org/index.php/Main_Page" class="external text external">Archived</a><span> 2015-03-17 at the </span><a href="Wayback_Machine" title="Wayback Machine">Wayback Machine</a></span></li><li id="cite_note-watcom_clib-6"> <span id="mw-reference-text-cite_note-watcom_clib-6" class="mw-reference-text"><a href="http://www.openwatcom.org/ftp/manuals/clib.pdf" class="external text external">OpenWatcom clib</a> <a href="https://web.archive.org/web/20061011042009/http://www.openwatcom.org/ftp/manuals/clib.pdf" class="external text external">Archived</a><span> 2006-10-11 at the </span><a href="Wayback_Machine" title="Wayback Machine">Wayback Machine</a>, openwatcom.org</span></li><li id="cite_note-7"> <span id="mw-reference-text-cite_note-7" class="mw-reference-text"><a href="http://www.digitalmars.com/" class="external text external">DigitalMars.com</a></span></li><li id="cite_note-mars_process.h-8"> <span id="mw-reference-text-cite_note-mars_process.h-8" class="mw-reference-text"><a href="http://www.digitalmars.com/rtl/process.html" class="external text external">Digital Mars process.h</a>, digitalmars.com</span></li><li id="cite_note-9"> <span id="mw-reference-text-cite_note-9" class="mw-reference-text"><a href="http://www.mingw.org/" class="external text external">MinGW.org</a></span></li><li id="cite_note-10"> <span id="mw-reference-text-cite_note-10" class="mw-reference-text"><cite class="citation web cs1"><a href="https://web.archive.org/web/20070707082306/http://msdn.microsoft.com/vstudio/express/visualc/default.aspx" class="external text external">"MSDN.Microsoft.com"</a>. Archived from <a href="http://msdn.microsoft.com/vstudio/express/visualc/default.aspx" class="external text external">the original</a> on 2007-07-07<span class="reference-accessdate">. Retrieved <span class="nowrap">2007-01-15</span></span>.</cite></span></li><li id="cite_note-11"> <span id="mw-reference-text-cite_note-11" class="mw-reference-text"><cite class="citation web cs1"><a href="https://web.archive.org/web/20121105211827/http://www.borland.com/" class="external text external">"Borland.com"</a>. Archived from <a href="http://www.borland.com/" class="external text external">the original</a> on 2012-11-05<span class="reference-accessdate">. Retrieved <span class="nowrap">2007-01-15</span></span>.</cite></span></li><li id="cite_note-turboc_2.0-12"> <span id="mw-reference-text-cite_note-turboc_2.0-12" class="mw-reference-text"><a href="http://dn.codegear.com/article/20841Turbo" class="external text external">C version 2.01</a>, dn.codegear.com</span></li><li id="cite_note-13"> <span id="mw-reference-text-cite_note-13" class="mw-reference-text"><a href="http://www.cs.virginia.edu/~lcc-win32/" class="external text external">CS.Virginia.edu</a></span></li><li id="cite_note-14"> <span id="mw-reference-text-cite_note-14" class="mw-reference-text"><a href="http://www.qnx.com/products/neutrino_rtos/" class="external text external">QNX.com</a></span></li><li id="cite_note-djgpp_spawn-15"> <span id="mw-reference-text-cite_note-djgpp_spawn-15" class="mw-reference-text"><a href="http://www.delorie.com/djgpp/doc/libc/libc_736.html" class="external text external">DJGPP spawn*</a>, delorie.com</span></li><li id="cite_note-msdn-16"> <span id="mw-reference-text-cite_note-msdn-16" class="mw-reference-text"><a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/HTML/_crt_system.2c_._wsystem.asp" class="external text external">Microsoft MSDN</a>, msdn.microsoft.com</span></li></ol></div>


    
</details><details data-level="2" open="">
    <summary class="section-heading"><h2 id="External_links">External links</h2></summary>
    
<ul><li><a href="http://www.digitalmars.com/rtl/process.html#_exec" class="external text external">Digital Mars _exec reference</a></li></ul>


<style data-mw-deduplicate="TemplateStyles:r999302996">.mw-parser-output cite.citation{font-style:inherit}.mw-parser-output .citation q{quotes:"\"""\"""'""'"}.mw-parser-output .id-lock-free a,.mw-parser-output .citation .cs1-lock-free a{background:linear-gradient(transparent,transparent),url("//upload.wikimedia.org/wikipedia/commons/6/65/Lock-green.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-limited a,.mw-parser-output .id-lock-registration a,.mw-parser-output .citation .cs1-lock-limited a,.mw-parser-output .citation .cs1-lock-registration a{background:linear-gradient(transparent,transparent),url("//upload.wikimedia.org/wikipedia/commons/d/d6/Lock-gray-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-subscription a,.mw-parser-output .citation .cs1-lock-subscription a{background:linear-gradient(transparent,transparent),url("//upload.wikimedia.org/wikipedia/commons/a/aa/Lock-red-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .cs1-subscription,.mw-parser-output .cs1-registration{color:#555}.mw-parser-output .cs1-subscription span,.mw-parser-output .cs1-registration span{border-bottom:1px dotted;cursor:help}.mw-parser-output .cs1-ws-icon a{background:linear-gradient(transparent,transparent),url("//upload.wikimedia.org/wikipedia/commons/4/4c/Wikisource-logo.svg")right 0.1em center/12px no-repeat}.mw-parser-output code.cs1-code{color:inherit;background:inherit;border:none;padding:inherit}.mw-parser-output .cs1-hidden-error{display:none;font-size:100%}.mw-parser-output .cs1-visible-error{font-size:100%}.mw-parser-output .cs1-maint{display:none;color:#33aa33;margin-left:0.3em}.mw-parser-output .cs1-format{font-size:95%}.mw-parser-output .cs1-kern-left,.mw-parser-output .cs1-kern-wl-left{padding-left:0.2em}.mw-parser-output .cs1-kern-right,.mw-parser-output .cs1-kern-wl-right{padding-right:0.2em}.mw-parser-output .citation .mw-selflink{font-weight:inherit}</style>
    
</details><!--htdig_noindex--><div><div style="clear:both; background-image:linear-gradient(180deg, #E8E8E8, white); border-top: dashed 2px #AAAAAA; padding: 0.5em 0.5em 0.5em 0.5em; margin-top: 1em; direction: ltr;">
    This article is issued from <a class="external text" title="Last edited on 2020-09-21" href="https://en.wikipedia.org/wiki/?title=Process.h&amp;oldid=979632117">Wikipedia</a>. The text is licensed under <a class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/">Creative Commons - Attribution - Sharealike</a>. Additional terms may apply for the media files.
</div>
</div><!--/htdig_noindex--></div>
        </div>
      </div>
    </div>
  </div>
  <script src="../-/mw/jsConfigVars.js"></script>
  <script src="../-/mw/startup.js"></script>
<script src="../-/mw/jquery.js"></script>
<script src="../-/mw/mediawiki.js"></script>
<script src="../-/mw/site.js"></script>
<script src="../-/mw/ext.cite.ux-enhancements.js"></script>



</body></html>