Helping ordinary people create extraordinary websites!
GET OUR NEWSLETTER
Your Email:
 

Port Windows IPC Apps to Linux, Part 1: Processes and Threads

By Srinivasan S. Muthuswamy, Kavitha Varadarajan
2005-06-16


Exiting a process

Exiting a process means a graceful exiting of the process with a proper cleanup. In Windows, you use ExitProcess() to perform this operation.


VOID ExitProcess(
UINT uExitCode // exit code for all threads
);

ExitProcess() is the preferred method of ending a process. This function provides a clean process shutdown. This includes calling the entry-point function of all attached dynamic-link libraries (DLLs) with a value indicating that the process is detaching from the DLL.

The Linux equivalent for ExitProcess() is exit(): void exit(int status);.

The exit() function causes normal program termination and the value of status &0377 is returned to the parent. The C standard specifies two definitions (EXIT_SUCCESS and EXIT_FAILURE) that can be passed to the status parameter to indicate successful or unsuccessful termination.



Tutorial Pages:
» A mapping guide for complex, multithreaded, multiprocess applications
» Processes
» Creating a process
» Terminating a process
» Using wait functions
» Exiting a process
» Environment variables
» Examples
» Threads
» Examples of processes and threads
» Next in the series
» Resources


First published by IBM DeveloperWorks


 | Bookmark
Related Tutorials:
» How to Install PHP 5 on Linux
» How to Install Apache 2 on Linux
» How to Install MySQL 5.0 on Linux
» SMB Caching
» Mound --Bind
» Tar Wild Card Interpretation

Advertise with Us!


Tutorials Scripts Web Hosting Developer Manuals
Resources