blob: 00229db0490f5480adf3cb2da57900db995aeab9 [file] [log] [blame]
rscb2cfc4e2003-09-30 17:47:41 +00001#include <lib9.h>
2
3void (*_sysfatal)(char*, ...);
4
5void
6sysfatal(char *fmt, ...)
7{
8 char buf[256];
9 va_list arg;
10
11 va_start(arg, fmt);
12 if(_sysfatal)
13 (*_sysfatal)(fmt, arg);
14 vseprint(buf, buf+sizeof buf, fmt, arg);
15 va_end(arg);
16
rsca995e472003-10-01 02:50:57 +000017 __fixargv0();
rsca0f1e212004-04-20 02:03:38 +000018 fprint(2, "%s: %s\n", argv0 ? argv0 : "<prog>", buf);
rscb2cfc4e2003-09-30 17:47:41 +000019 exits("fatal");
20}
21