use vc_get_task_xid() instead of vc_X_getctx()
authorEnrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Wed, 21 Jan 2004 19:01:01 +0000 (19:01 +0000)
committerEnrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Wed, 21 Jan 2004 19:01:01 +0000 (19:01 +0000)
git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@675 94cd875c-1c1d-0410-91d2-eb244daf1a30

util-vserver/src/save_ctxinfo.c
util-vserver/src/vps.c
util-vserver/src/vserver-stat.c
util-vserver/src/wrappers-vserver.h
util-vserver/tests/getctx.c

index f46ec12..7becf5b 100644 (file)
@@ -58,7 +58,7 @@ int main(int argc, char *argv[])
   strcpy(runfile,      argv[1]);
   strcpy(runfile+len1, "/run");
 
-  ctx=Evc_X_getctx(0);
+  ctx=Evc_get_task_xid(0);
 
   if (ctx==0) {
     WRITE_MSG(2, "save_ctxinfo: Can not operate in context 0\n");
index a02b09f..99ee4a9 100644 (file)
@@ -96,7 +96,7 @@ extractCtx(char *pid_str)
   while (*pid_str==' ') ++pid_str;
   pid = atoi(pid_str);
 
-  return vc_X_getctx(pid);
+  return vc_get_task_xid(pid);
 }
 
 static char const *
@@ -217,7 +217,7 @@ int main(int argc, char *argv[])
     if (strcmp(argv[1], "--version")==0) showVersion();
   }
     
-  if (vc_X_getctx(0)!=1)
+  if (vc_get_task_xid(0)!=1)
     Evc_new_s_context(1, vc_get_securecaps(), 0);
 
   Epipe(p);
index 7e2e029..d107121 100644 (file)
@@ -253,13 +253,13 @@ free_ctx(struct ctx_list *list)
 // open the process's status file to get the ctx number, and other stat
 struct process_info *get_process_info(char *pid)
 {
-  int          fd;
-  char         buffer[1024];
-  char         *p;
-  size_t               idx, l=strlen(pid);
-  static struct process_info process;
+  int                          fd;
+  char                         buffer[1024];
+  char                         *p;
+  size_t                       idx, l=strlen(pid);
+  static struct process_info   process;
 
-  process.s_context = vc_X_getctx(atoi(pid));
+  process.s_context = vc_get_task_xid(atoi(pid));
 
   
   memcpy(buffer,     "/proc/", 6); idx  = 6;
index 82bc2c0..d407c0c 100644 (file)
@@ -30,10 +30,10 @@ Evc_new_s_context(xid_t ctx, unsigned int remove_cap, unsigned int flags)
 }
 
 inline static UNUSED xid_t
-Evc_X_getctx(pid_t pid)
+Evc_get_task_xid(pid_t pid)
 {
-  register xid_t       res = vc_X_getctx(pid);
-  FatalErrnoError(res==VC_NOCTX, "vc_X_getctx()");
+  register xid_t       res = vc_get_task_xid(pid);
+  FatalErrnoError(res==VC_NOCTX, "vc_get_task_xid()");
   return res;
 }
 
index 15657c3..0a7b492 100644 (file)
@@ -33,8 +33,8 @@ int main(int argc, char *argv[])
   char         buf[sizeof(int)*3+2];
   xid_t                ctx;
   
-  if (argc==1) ctx = vc_X_getctx(0);
-  else         ctx = vc_X_getctx(atoi(argv[1]));
+  if (argc==1) ctx = vc_get_task_xid(0);
+  else         ctx = vc_get_task_xid(atoi(argv[1]));
 
   utilvserver_fmt_int(buf, ctx);