ia64/xen-unstable

view tools/libxc/xc_io.c @ 4895:24dfd18ea63e

bitkeeper revision 1.1159.258.120 (42848bfe8kMyWWcBA64rq7h7l7AyoA)

Shadow code bug fix (found by Ian) that was breaking refcounts, and subsequently
causing migration problems.
author mafetter@fleming.research
date Fri May 13 11:14:06 2005 +0000 (2005-05-13)
parents 1511d2acc1a4
children 0a4b76b6b5a0
line source
1 #include "xc_io.h"
2 #include <sys/time.h>
4 void xcio_timestamp(XcIOContext *ctxt, const char *msg){
5 struct timeval tv;
7 gettimeofday(&tv, NULL);
8 if (msg[0] != '\b' && msg[0] != '\r')
9 fprintf(stdout, "[%08ld.%06ld] ", tv.tv_sec, tv.tv_usec);
10 }
12 void xcio_error(XcIOContext *ctxt, const char *msg, ...){
13 va_list args;
15 va_start(args, msg);
16 vfprintf(stdout, msg, args); fprintf(stdout, "\n"); fflush(stdout);
17 IOStream_vprint(ctxt->info, msg, args);
18 IOStream_print(ctxt->info, "\n");
19 va_end(args);
20 }
22 void xcio_info(XcIOContext *ctxt, const char *msg, ...){
23 va_list args;
25 if(0 && !(ctxt->flags & XCFLAGS_VERBOSE)) return;
26 va_start(args, msg);
27 xcio_timestamp(ctxt, msg);
28 vfprintf(stdout, msg, args); fprintf(stdout, "\n");
29 IOStream_vprint(ctxt->info, msg, args);
30 fflush(stdout);
31 va_end(args);
32 }
34 void xcio_debug(XcIOContext *ctxt, const char *msg, ...){
35 va_list args;
37 if(0 && !(ctxt->flags & XCFLAGS_DEBUG)) return;
38 va_start(args, msg);
39 xcio_timestamp(ctxt, msg);
40 vfprintf(stdout, msg, args); fprintf(stdout, "\n");
41 IOStream_vprint(ctxt->info, msg, args);
42 va_end(args);
43 }