merge ROS Shell without integrated explorer part into trunk
[reactos.git] / posix / lib / psxdll / stdlib / exit.c
1 /* $Id: exit.c,v 1.4 2002/10/29 04:45:41 rex Exp $
2 */
3 /*
4 * COPYRIGHT: See COPYING in the top level directory
5 * PROJECT: ReactOS POSIX+ Subsystem
6 * FILE: subsys/psx/lib/psxdll/stdlib/exit.c
7 * PURPOSE: Terminate a process
8 * PROGRAMMER: KJK::Hyperion <noog@libero.it>
9 * UPDATE HISTORY:
10 * 27/12/2001: Created
11 */
12
13 #include <ddk/ntddk.h>
14 #include <stdlib.h>
15 #include <psx/debug.h>
16
17 void exit(int status)
18 {
19 TODO("call all functions registered with atexit()");
20
21 TODO("flush all output streams, close all open streams");
22 TODO("remove all files created by tmpfile()");
23
24 TODO("close all of the file descriptors, directory streams, conversion \
25 descriptors and message catalogue descriptors");
26 TODO("send SIGCHILD to the parent process");
27 TODO("set parent pid of children to pid of psxss");
28 TODO("detach each attached shared-memory segment");
29 TODO("for each semaphore for which the calling process has set a semadj \
30 value(), add the value to the semval of the semaphore.");
31 TODO("if the process is a controlling process, send SIGHUP to each process \
32 in the foreground process group...");
33 TODO("... and disassociate the terminal from the session");
34 TODO("if the exit causes a process group to become orphaned, and if any \
35 member of the newly-orphaned process group is stopped, send SIGHUP and \
36 SIGCONT to each process in the newly-orphaned process group");
37 TODO("all open named semaphores in the calling process are closed");
38 TODO("remove any memory locks");
39 TODO("destroy memory mappings");
40 TODO("close all open message queue descriptors");
41
42 #if 0
43 ExitProcess(status);
44 #endif
45
46 NtTerminateProcess(NtCurrentProcess(), status);
47
48 }
49
50 /* EOF */
51