#include "util.h"
#include "internal.h"
#include "wrappers.h"
+#include "wrappers-dirent.h"
+#include "wrappers-vserver.h"
#include <stdio.h>
#include <stdlib.h>
// 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;
#if 1
// try to switch in context 1
- if (vc_new_s_context(1,0, 0) < 0)
- {
- perror("vc_new_s_context(#1,...)");
- return EXIT_FAILURE;
- }
+ Evc_new_s_context(1, 0,0);
#endif
// create the fist...
// init with the default name for the context 0
strncpy(my_ctx_list->name, "root server", CTX_NAME_MAX_LEN);
- // open the /proc dir
- if ((proc_dir = opendir(PROC_DIR_NAME)) == NULL) {
- perror("opendir()");
- return EXIT_FAILURE;
- }
-
- chdir(PROC_DIR_NAME);
+
+ Echdir(PROC_DIR_NAME);
+ proc_dir = Eopendir(".");
while ((dir_entry = readdir(proc_dir)) != NULL)
{
// select only process file