initial import

This commit is contained in:
garbeam@wmii.de
2005-11-20 18:27:27 +02:00
commit e5f0f74b8a
323 changed files with 41871 additions and 0 deletions

26
lib9/sysfatal.c Normal file
View File

@@ -0,0 +1,26 @@
#include <lib9.h>
#include <stdarg.h>
#include "fmt.h"
extern char *argv0;
extern void __fixargv0(void);
extern void exits(char*);
void (*_sysfatal)(char*, ...);
void
sysfatal(char *fmt, ...)
{
char buf[256];
va_list arg;
va_start(arg, fmt);
if(_sysfatal)
(*_sysfatal)(fmt, arg);
vseprint(buf, buf+sizeof buf, fmt, arg);
va_end(arg);
__fixargv0();
fprint(2, "%s: %s\n", argv0 ? argv0 : "<prog>", buf);
exits("fatal");
}