X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=util-vserver%2Ftests%2Fgetctx.c;h=0a7b492021a0cb8f0ee84eda216b5ed61eafac7f;hb=41815c3a043fd94adcbf54e52ee891a3e44313fa;hp=577f35c3058ed64f2328e2f296ec58f1aeb4632c;hpb=f66a0ab931904d39698dc7ac8af83571fd8bde05;p=util-vserver.git diff --git a/util-vserver/tests/getctx.c b/util-vserver/tests/getctx.c index 577f35c..0a7b492 100644 --- a/util-vserver/tests/getctx.c +++ b/util-vserver/tests/getctx.c @@ -22,15 +22,24 @@ #include "compat.h" #include "vserver.h" +#include "internal.h" +#include "src/util.h" -#include #include #include int main(int argc, char *argv[]) { - if (argc==1) printf("%i\n", vc_X_getctx(0)); - 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; }