source: trunk/minix/lib/posix/__exit.c@ 10

Last change on this file since 10 was 9, checked in by Mattia Monga, 13 years ago

Minix 3.1.2a

File size: 447 bytes
Line 
1#define _exit __exit
2#include <lib.h>
3#include <unistd.h>
4
5PUBLIC void _exit(status)
6int status;
7{
8 void (*suicide)(void);
9 message m;
10
11 m.m1_i1 = status;
12 _syscall(MM, EXIT, &m);
13
14 /* If exiting nicely through PM fails for some reason, try to
15 * commit suicide. E.g., message to PM might fail due to deadlock.
16 */
17 suicide = (void (*)(void)) -1;
18 suicide();
19
20 /* If committing suicide fails for some reason, hang. */
21 for(;;) { }
22}
23
Note: See TracBrowser for help on using the repository browser.