Signed-off-by: Jens Axboe <axboe@kernel.dk>
OBJS = $(SOURCE:.c=.o)
T_OBJS = t/stest.o
OBJS = $(SOURCE:.c=.o)
T_OBJS = t/stest.o
-T_OBJS += mutex.o smalloc.o
+T_OBJS += mutex.o smalloc.o t/log.o
T_PROGS = t/stest
ifneq ($(findstring $(MAKEFLAGS),s),s)
T_PROGS = t/stest
ifneq ($(findstring $(MAKEFLAGS),s),s)
--- /dev/null
+#include <stdio.h>
+#include <stdarg.h>
+
+int log_err(const char *format, ...)
+{
+ char buffer[1024];
+ va_list args;
+ size_t len;
+
+ va_start(args, format);
+ len = vsnprintf(buffer, sizeof(buffer), format, args);
+ va_end(args);
+
+ return fwrite(buffer, len, 1, stderr);
+}