use $(LIBENSCVECTOR) instead of libensc_vector.a
[util-vserver.git] / util-vserver / tests / getctx.c
index 2184481..0a7b492 100644 (file)
 
 #include "compat.h"
 #include "vserver.h"
+#include "internal.h"
+#include "src/util.h"
 
-#include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
 
 int main(int argc, char *argv[])
 {
-  if (argc==1) printf("%i\n", vc_X_getcctx());
-  else         printf("%i\n", vc_X_getctx(atoi(argv[1])));
+  char         buf[sizeof(int)*3+2];
+  xid_t                ctx;
+  
+  if (argc==1) ctx = vc_get_task_xid(0);
+  else         ctx = vc_get_task_xid(atoi(argv[1]));
+
+  utilvserver_fmt_int(buf, ctx);
+
+  WRITE_STR(1, buf);
+  WRITE_MSG(1, "\n");
 
   return 0;
 }