s!ctx_t!xid_t!
[util-vserver.git] / util-vserver / lib / syscall-compat.hc
index 899932b..fb07d4d 100644 (file)
 #ifdef HAVE_CONFIG_H
 #  include <config.h>
 #endif
-
 #include "compat.h"
+
+#include "safechroot-internal.hc"
+
 #include "vserver.h"
 #include "vserver-internal.h"
 
 #include <unistd.h>
 
 static inline ALWAYSINLINE int
-vc_new_s_context_compat(ctx_t ctx, unsigned int remove_cap, unsigned int flags)
+vc_new_s_context_compat(xid_t ctx, unsigned int remove_cap, unsigned int flags)
 {
-  struct vcmd_new_s_context_v1 msg = {
-    .remove_cap = remove_cap,
-    .flags      = flags
-  };
+  struct vcmd_new_s_context_v1 msg;
+  msg.remove_cap = remove_cap;
+  msg.flags      = flags;
 
-  return sys_virtual_context(VC_CMD(COMPAT, 1, 1), ctx, &msg);
+  return vserver(VC_CMD(COMPAT, 1, 1), CTX_USER2KERNEL(ctx), &msg);
 }
 
 static inline ALWAYSINLINE int
 vc_set_ipv4root_compat(uint32_t  bcast, size_t nb, struct vc_ip_mask_pair const *ips)
 {
-  struct vcmd_set_ipv4root_v3  msg = {
-    .broadcast  = bcast
-  };
+  struct vcmd_set_ipv4root_v3  msg;
   size_t                       i;
 
   if (nb>=NB_IPV4ROOT) {
@@ -50,12 +49,14 @@ vc_set_ipv4root_compat(uint32_t  bcast, size_t nb, struct vc_ip_mask_pair const
     return -1;
   }
 
+  msg.broadcast = bcast;
+
   for (i=0; i<nb; ++i) {
     msg.ip_mask_pair[i].ip   = ips[i].ip;
     msg.ip_mask_pair[i].mask = ips[i].mask;
   }
 
-  return sys_virtual_context(VC_CMD(COMPAT, 2, 3), nb, &msg);
+  return vserver(VC_CMD(COMPAT, 2, 3), nb, &msg);
 }
 
 static inline ALWAYSINLINE int