3 #include <minix/sysutil.h>
9 /*===========================================================================*
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.
22 void (*suicide
)(void);
25 if (NULL
!= who
&& NULL
!= mess
) {
27 printf("Panic in %s: %s: %d\n", who
, mess
, num
);
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;
42 /* If committing suicide fails for some reason, hang. */