Process.h

Last updated

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 extenders 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 standard or by POSIX.

Contents

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 version 3.0. 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.

Functions

NameDescriptionNotes
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

NameDescriptionNotesOS
_P_WAITSuspends parent process until the child process has finished executing.synchronous spawn.MS-DOS,Win32,OS/2
_P_NOWAIT, _P_NOWAITOContinues to execute calling process concurrently with new process.asynchronous spawn.Win32,OS/2
_P_OVERLAYOverlays parent process with child, which destroys the parent.has the same effect as the exec* functions.MS-DOS,Win32,OS/2
_P_DETACHThe 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_CHILDused as cwait action.Obsolete on Win32.MS-DOS,OS/2
_WAIT_GRANDCHILDused 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.

Differences

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

Related Research Articles

ANSI C, ISO C and Standard C are successive standards for the C programming language published by the American National Standards Institute (ANSI) and the International Organization for Standardization (ISO). Historically, the names referred specifically to the original and best-supported version of the standard. Software developers writing in C are encouraged to conform to the standards, as doing so helps portability between compilers.

The Portable Operating System Interface (POSIX) is a family of standards specified by the IEEE Computer Society for maintaining compatibility between operating systems. POSIX defines the application programming interface (API), along with command line shells and utility interfaces, for software compatibility with variants of Unix and other operating systems.

Pascal (programming language) Programming language

Pascal is an imperative and procedural programming language, designed by Niklaus Wirth as a small, efficient language intended to encourage good programming practices using structured programming and data structuring. It is named in honour of the French mathematician, philosopher and physicist Blaise Pascal.

Turbo Pascal

Turbo Pascal is a software development system that includes a compiler and an integrated development environment (IDE) for the Pascal programming language running on CP/M, CP/M-86, and DOS. It was originally developed by Anders Hejlsberg at Borland, and was notable for its extremely fast compiling times. Turbo Pascal, and the later but similar Turbo C, made Borland a leader in PC-based development.

Turbo C is a discontinued integrated development environment (IDE) and compiler for the C programming language from Borland. First introduced in 1987, it was noted for its integrated development environment, small size, fast compile speed, comprehensive manuals and low price.

The Windows API, informally WinAPI, is Microsoft's core set of application programming interfaces (APIs) available in the Microsoft Windows operating systems. The name Windows API collectively refers to several different platform implementations that are often referred to by their own names ; see the versions section. Almost all Windows programs interact with the Windows API. On the Windows NT line of operating systems, a small number use the Native API.

The BMP file format, also known as bitmap image file, device independent bitmap (DIB) file format and bitmap, is a raster graphics image file format used to store bitmap digital images, independently of the display device, especially on Microsoft Windows and OS/2 operating systems.

Watcom International Corporation was founded in 1981 by Wes Graham and Ian McPhee. Founding staff were formerly members of Professor Graham's Computer Systems Group at the University of Waterloo, in Waterloo, Ontario, Canada. Watcom produced a variety of tools, including the well-known Watcom C/C++ compiler introduced in 1988.

Microsoft Foundation Class Library (MFC) is a C++ object-oriented library for developing desktop applications for Windows.

In computer programming, the term magic number has multiple meanings. It could refer to one or more of the following:

DJGPP Implementation of the GNU toolchain for DOS

DJ's GNU Programming Platform (DJGPP) is a software development suite for Intel 80386-level and above, IBM PC compatibles which supports DOS operating systems. It is guided by DJ Delorie, who began the project in 1989. It is a port of the GNU Compiler Collection (GCC), and mostly GNU utilities such as Bash, find, tar, ls, GAWK, sed, and ld to DOS Protected Mode Interface (DPMI). Supported languages include C, C++, Objective-C/C++, Ada, Fortran, and Pascal. DJGPP was described as an "aging" product in 2004.

A DOS extender is a computer software program running under DOS that enables software to run in a protected mode environment even though the host operating system is only capable of operating in real mode.

Microsoft Pascal

Microsoft Pascal is a discontinued implementation of the Pascal programming language developed by the Microsoft Corporation for compiling programs for running on its MS-DOS and Xenix operating systems and, in later versions, on OS/2.

Watcom C/C++

Watcom C/C++ is an integrated development environment (IDE) product from Watcom International Corporation for the C, C++, and Fortran programming languages. Watcom C/C++ was a commercial product until it was discontinued, then released under the Sybase Open Watcom Public License as Open Watcom C/C++. It features tools for developing and debugging code for DOS, OS/2, Windows, Linux operating systems, which are based upon x86, IA-32, x86-64 compatible processors.

In computer programming, a precompiled header is a header file that is compiled into an intermediate form that is faster to process for the compiler. Usage of precompiled headers may significantly reduce compilation time, especially when applied to large header files, header files that include many other header files, or header files that are included in many translation units.

The DOS MZ executable format is the executable file format used for .EXE files in DOS.

Borland C++ is a C and C++ IDE for MS-DOS and Microsoft Windows. It was the successor to Turbo C++, and included a better debugger, the Turbo Debugger, which was written in protected mode DOS.

This article describes the calling conventions used when programming x86 architecture microprocessors.

conio.h is a C header file used mostly by MS-DOS compilers to provide console input/output. It is not part of the C standard library or ISO C, nor is it defined by POSIX.

Microsoft was one of the first companies to implement Unicode in their products. Windows NT was the first operating system that used "wide characters" in system calls. Using the UCS-2 encoding scheme at first, it was upgraded to UTF-16 starting with Windows 2000, allowing a representation of additional planes with surrogate pairs. Nevertheless, Microsoft failed to support UTF-8 until 2017. In May 2019 Microsoft reversed course and started recommending using UTF-8 exclusively.

References

  1. "Copyright 1985–1989, Microsoft Corporation", in QuickC version 2.00 process.h file
  2. Is my floppy diskette formated?, groups-beta.google.com
  3. Delorie.com
  4. DJGPP process.h, delorie.com
  5. Openwatcom.org Archived 2015-03-17 at the Wayback Machine
  6. OpenWatcom clib Archived 2006-10-11 at the Wayback Machine , openwatcom.org
  7. DigitalMars.com
  8. Digital Mars process.h, digitalmars.com
  9. MinGW.org
  10. "MSDN.Microsoft.com". Archived from the original on 2007-07-07. Retrieved 2007-01-15.
  11. "Borland.com". Archived from the original on 2012-11-05. Retrieved 2007-01-15.
  12. C version 2.01 [ permanent dead link ], dn.codegear.com
  13. CS.Virginia.edu
  14. QNX.com
  15. DJGPP spawn*, delorie.com
  16. Microsoft MSDN, msdn.microsoft.com