1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19#include <linux/kernel.h>
20#include <linux/string.h>
21#include <stdarg.h>
22#include "nonstdio.h"
23
24extern int xmon_write(void *, void *, int);
25
26void
27xmon_vfprintf(void *f, const char *fmt, va_list ap)
28{
29 static char xmon_buf[2048];
30 int n;
31
32 n = vsprintf(xmon_buf, fmt, ap);
33 xmon_write(f, xmon_buf, n);
34}
35
36void
37xmon_printf(const char *fmt, ...)
38{
39 va_list ap;
40
41 va_start(ap, fmt);
42 xmon_vfprintf(stdout, fmt, ap);
43 va_end(ap);
44}
45
46void
47xmon_fprintf(void *f, const char *fmt, ...)
48{
49 va_list ap;
50
51 va_start(ap, fmt);
52 xmon_vfprintf(f, fmt, ap);
53 va_end(ap);
54}
55
56