X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=util-vserver%2Ftests%2Fgetctx.c;h=0a7b492021a0cb8f0ee84eda216b5ed61eafac7f;hb=3eb1b2279739d0f16391a3724a9897c686f030d3;hp=218448104273218a35b894bb1116980ad9d92000;hpb=bb649794f34dadb3fd60c738623ad5b160613e37;p=util-vserver.git diff --git a/util-vserver/tests/getctx.c b/util-vserver/tests/getctx.c index 2184481..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_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; }