xref: /haiku/src/system/libroot/posix/unistd/_exit.c (revision 917c4aeb8db75492ad8aa0b2c62ca47c905a74fe)
1 /*
2  * Copyright 2004, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
3  * Distributed under the terms of the MIT License.
4  */
5 
6 
7 #include <stdlib.h>
8 #include <unistd.h>
9 #include <syscalls.h>
10 
11 
12 extern void _IO_cleanup(void);
13 
14 void
_exit(int status)15 _exit(int status)
16 {
17 	// close all open files
18 	_IO_cleanup();
19 
20 	// exit with status code
21 	_kern_exit_team(status);
22 }
23 
24 
25 void
_Exit(int status)26 _Exit(int status)
27 {
28 	_exit(status);
29 }