Files
haiku-beta6/src/kernel/vm2/error.C
T

21 lines
555 B
C++
Raw Normal View History

#include <OS.h>
#include <stdio.h>
#include <stdarg.h>
static sem_id errorPrinting=0;
// Create a function for standardized formats. Wish I could get rid of the warning associated with this...
void error(char *fmt, ...)
{
if (errorPrinting==0)
errorPrinting=create_sem(1,"error_printing");
acquire_sem(errorPrinting);
va_list argp;
2002-11-19 04:05:16 +00:00
char tmp[2000];
sprintf(tmp, "[%lld] error: %s",real_time_clock_usecs(),fmt);
va_start(argp, tmp);
vfprintf(stderr,tmp,argp);
va_end(argp);
release_sem(errorPrinting);
}