Make /dev/c1* device nodes on disk and on the boot ramdisk.
[minix3.git] / lib / syslib / panic.c
blob72d7329073e074e73fed35609e2a633af5a1c2d8
1 #include <stdlib.h>
2 #include <signal.h>
3 #include <minix/sysutil.h>
5 #include "syslib.h"
7 int panicing= 0;
9 /*===========================================================================*
10 * panic *
11 *===========================================================================*/
12 PUBLIC void panic(who, mess, num)
13 char *who; /* server identification */
14 char *mess; /* message format string */
15 int num; /* number to go with format string */
17 /* Something awful has happened. Panics are caused when an internal
18 * inconsistency is detected, e.g., a programming error or illegal
19 * value of a defined constant.
21 message m;
22 void (*suicide)(void);
24 panicing= 1;
25 if (NULL != who && NULL != mess) {
26 if (num != NO_NUM) {
27 printf("Panic in %s: %s: %d\n", who, mess, num);
28 } else {
29 printf("Panic in %s: %s\n", who, mess);
33 /* Try to signal ourself */
34 sys_kill(SELF, SIGKILL);
36 /* If exiting nicely through PM fails for some reason, try to
37 * commit suicide. E.g., message to PM might fail due to deadlock.
39 suicide = (void (*)(void)) -1;
40 suicide();
42 /* If committing suicide fails for some reason, hang. */
43 for(;;) { }