String_c_str(): added
[util-vserver.git] / util-vserver / lib / vserver.h
index 88423fb..9204a64 100644 (file)
@@ -60,6 +60,7 @@
 
 /** the value which is returned in error-case (no ctx found) */
 #define VC_NOCTX               ((xid_t)(-1))
+#define VC_NOXID               ((xid_t)(-1))
 /** the value which means a random (the next free) ctx */
 #define VC_DYNAMIC_XID         ((xid_t)(-1))
 /** the value which means the current ctx */
 #define VC_VXC_SECURE_MOUNT            0x00010000ull
 
 
+#define VC_VXSM_FILL_RATE              0x0001
+#define VC_VXSM_INTERVAL               0x0002
+#define VC_VXSM_TOKENS                 0x0010
+#define VC_VXSM_TOKENS_MIN             0x0020
+#define VC_VXSM_TOKENS_MAX             0x0040
+#define VC_VXSM_PRIO_BIAS              0x0100
+
+
+
 /** \defgroup  syscalls Syscall wrappers
  *  Functions which are calling the vserver syscall directly. */
 
@@ -203,10 +213,24 @@ extern "C" {
 #endif
 
   struct vc_ip_mask_pair {
-    uint32_t   ip;
+      uint32_t ip;
       uint32_t mask;
   };
 
+    /** \brief   The generic vserver syscall
+     *  \ingroup syscalls
+     *
+     *  This function executes the generic vserver syscall. It uses the
+     *  correct syscallnumber (which may differ between the different
+     *  architectures).
+     *
+     *  \params  cmd  the command to be executed
+     *  \params  xid  the xid on which the cmd shall be applied
+     *  \params  data additional arguments; depends on \c cmd
+     *  \returns depends on \c cmd; usually, -1 stands for an error
+     */
+  int  vc_syscall(uint32_t cmd, xid_t xid, void *data);
+
     /** \brief   Returns the version of the current kernel API.
      *  \ingroup syscalls
      * \returns The versionnumber of the kernel API
@@ -351,7 +375,7 @@ extern "C" {
   struct vc_nx_info {
       nid_t    nid;
   };
-  
+
   nid_t                vc_get_task_nid(pid_t pid);
   int          vc_get_nx_info(nid_t nid, struct vc_nx_info *) VC_ATTR_NONNULL((2));
 
@@ -401,7 +425,12 @@ extern "C" {
       pid_t    initpid;
   };
   
-    /** Returns the context of the given process. pid==0 means the current process. */
+    /** \brief  Returns the context of the given process.
+     *
+     *  \params pid  the process-id whose xid shall be determined;
+     *               pid==0 means the current process.
+     *  \returns     the xid of process \c pid or -1 on errors
+     */
   xid_t                vc_get_task_xid(pid_t pid);
   int          vc_get_vx_info(xid_t xid, struct vc_vx_info *info) VC_ATTR_NONNULL((2));
 
@@ -451,6 +480,7 @@ extern "C" {
   };
 
   /** \brief    Information about parsing errors
+   *  \ingroup  helper
    */
   struct vc_err_listparser {
       char const       *ptr;           ///< Pointer to the first character of an erroneous string
@@ -572,12 +602,13 @@ extern "C" {
 
 
   struct vc_set_sched {
-      int32_t  fill_rate;
-      int32_t  interval;
-      int32_t  tokens;
-      int32_t  tokens_min;
-      int32_t  tokens_max;
-      uint64_t cpu_mask;
+      uint_least32_t   set_mask;
+      int_least32_t    fill_rate;
+      int_least32_t    interval;
+      int_least32_t    tokens;
+      int_least32_t    tokens_min;
+      int_least32_t    tokens_max;
+      int_least32_t    priority_bias;
   };
 
   int          vc_set_sched(xid_t xid, struct vc_set_sched const *);