Make vc_get_ccaps do the right thing.
[util-vserver.git] / lib / vserver.h
index a6708a7..38e4c5a 100644 (file)
 
 #define VC_VXSM_IDLE_TIME              0x0200
 #define VC_VXSM_FORCE                  0x0400
+#define VC_VXSM_MSEC                   0x4000
 
 #define VC_VXSM_V3_MASK                        0x0173
 
 #define VC_DATTR_REMAP                 0x00000010
 
 
+// the process context migration flags
+#define VC_VXM_SET_INIT                        0x00000001
+#define VC_VXM_SET_REAPER              0x00000002
+
+
 #ifndef CLONE_NEWNS
 #  define CLONE_NEWNS                  0x00020000
 #endif
@@ -392,9 +398,10 @@ extern "C" {
     /** \brief   Moves the current process into the specified context.
      *  \ingroup syscalls
      *
-     *  \param   xid  The new context
+     *  \param   xid    The new context
+     *  \param   flags  The flags, see VC_VXM_*
      *  \returns 0 on success, -1 on errors */
-  int          vc_ctx_migrate(xid_t xid);
+  int          vc_ctx_migrate(xid_t xid, uint_least64_t flags);
 
     /** \brief   Statistics about a context */
   struct vc_ctx_stat {
@@ -414,7 +421,7 @@ extern "C" {
     /** \brief   Contains further statistics about a context. */
   struct vc_virt_stat {
       uint_least64_t   offset;
-      uint_least32_t   uptime;
+      uint_least64_t   uptime;
       uint_least32_t   nr_threads;
       uint_least32_t   nr_running;
       uint_least32_t   nr_uninterruptible;
@@ -720,9 +727,9 @@ extern "C" {
   /** Get a disk limit. */
   int          vc_get_dlimit(char const *filename, xid_t xid,
                              uint_least32_t flags,
-                             struct vc_ctx_dlimit *limits) VC_ATTR_NONNULL((1,4));
+                             struct vc_ctx_dlimit *limits) VC_ATTR_NONNULL((1));
 
-    /* misc. syscalls */
+    /* scheduler related syscalls */
   struct vc_set_sched {
       uint_least32_t   set_mask;
       int_least32_t    fill_rate;
@@ -739,6 +746,19 @@ extern "C" {
 
   int          vc_set_sched(xid_t xid, struct vc_set_sched const *) VC_ATTR_NONNULL((2));
 
+  struct vc_sched_info {
+      int_least32_t    cpu_id;
+      int_least32_t    bucket_id;
+      uint_least64_t   user_msec;
+      uint_least64_t   sys_msec;
+      uint_least64_t   hold_msec;
+      uint_least32_t   token_usec;
+      int_least32_t    vavavoom;
+  };
+
+  int          vc_sched_info(xid_t xid, struct vc_sched_info *info) VC_ATTR_NONNULL((2));
+
+    /* misc. syscalls */
   int          vc_set_mapping(xid_t xid, const char *device, const char *target, uint32_t flags);
 
 
@@ -870,7 +890,7 @@ extern "C" {
                 vcFEATURE_COMPAT, vcFEATURE_MIGRATE, vcFEATURE_NAMESPACE,
                 vcFEATURE_SCHED,  vcFEATURE_VINFO,   vcFEATURE_VHI,
                  vcFEATURE_VSHELPER0, vcFEATURE_VSHELPER, vcFEATURE_VWAIT,
-                vcFEATURE_VNET }
+                vcFEATURE_VNET, vcFEATURE_VSTAT }
     vcFeatureSet;
 
   bool         vc_isSupported(vcFeatureSet) VC_ATTR_CONST;