added int2str.c
[util-vserver.git] / util-vserver / lib / vserver.h
index e476f4d..c4b5f76 100644 (file)
 #include <stdlib.h>
 #include <sys/types.h>
 
-#define VC_NOCTX       ((ctx_t)(-1))
+#ifndef VC_NOCTX
+#  define VC_NOCTX     ((ctx_t)(-1))
+#endif
+
+#ifndef S_CTX_INFO_LOCK
+#  define S_CTX_INFO_LOCK      1
+#endif
+
+#ifndef S_CTX_INFO_SCHED
+#  define S_CTX_INFO_SCHED     2
+#endif
+
+#ifndef S_CTX_INFO_NPROC
+#  define S_CTX_INFO_NPROC     4
+#endif
+
+#ifndef S_CTX_INFO_PRIVATE
+#  define S_CTX_INFO_PRIVATE   8
+#endif
+
+#ifndef S_CTX_INFO_INIT
+#  define S_CTX_INFO_INIT      16
+#endif
+
+#ifndef S_CTX_INFO_HIDEINFO
+#  define S_CTX_INFO_HIDEINFO  32
+#endif
+
+#ifndef S_CTX_INFO_ULIMIT
+#  define S_CTX_INFO_ULIMIT    64
+#endif
+
 
 #ifdef __cplusplus
 extern "C" {
@@ -52,12 +83,12 @@ extern "C" {
   int  vc_chrootsafe(char const *dir);
 
 
-    /** Returns the context of the given process. */
+    /** Returns the context of the given process. pid==0 means the current process. */
   ctx_t        vc_X_getctx(pid_t pid);
 
-    /** Returns the context of the current process. */
-#define vc_X_getcctx           (getctx(getpid()))
-    
+    /** Returns the pid of the 'init' process */
+  pid_t        vc_X_getinitpid(pid_t pid);
+  
 #ifdef __cplusplus
 }
 #endif