Blame


1 b2cfc4e2 2003-09-30 devnull #include <lib9.h>
2 b2cfc4e2 2003-09-30 devnull
3 b2cfc4e2 2003-09-30 devnull void (*_sysfatal)(char*, ...);
4 b2cfc4e2 2003-09-30 devnull
5 b2cfc4e2 2003-09-30 devnull void
6 b2cfc4e2 2003-09-30 devnull sysfatal(char *fmt, ...)
7 b2cfc4e2 2003-09-30 devnull {
8 b2cfc4e2 2003-09-30 devnull char buf[256];
9 b2cfc4e2 2003-09-30 devnull va_list arg;
10 b2cfc4e2 2003-09-30 devnull
11 b2cfc4e2 2003-09-30 devnull va_start(arg, fmt);
12 b2cfc4e2 2003-09-30 devnull if(_sysfatal)
13 b2cfc4e2 2003-09-30 devnull (*_sysfatal)(fmt, arg);
14 b2cfc4e2 2003-09-30 devnull vseprint(buf, buf+sizeof buf, fmt, arg);
15 b2cfc4e2 2003-09-30 devnull va_end(arg);
16 b2cfc4e2 2003-09-30 devnull
17 a995e477 2003-10-01 devnull __fixargv0();
18 a0f1e21f 2004-04-20 devnull fprint(2, "%s: %s\n", argv0 ? argv0 : "<prog>", buf);
19 b2cfc4e2 2003-09-30 devnull exits("fatal");
20 b2cfc4e2 2003-09-30 devnull }