added CTX_NOCTX macro
authorEnrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Thu, 9 Oct 2003 01:38:25 +0000 (01:38 +0000)
committerEnrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Thu, 9 Oct 2003 01:38:25 +0000 (01:38 +0000)
added getctx()/getcctx() functions
added ctx_t datatype

git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@60 94cd875c-1c1d-0410-91d2-eb244daf1a30

util-vserver/lib/vserver.h

index 5485446..e425fc1 100644 (file)
 #ifndef H_VSERVER_SYSCALL_H
 #define H_VSERVER_SYSCALL_H
 
+#include <sys/types.h>
+#include <unistd.h>
+
+#define CTX_NOCTX      ((ctx_t)(-1))
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
+  typedef short int    ctx_t;
+
 int call_new_s_context(int nbctx, int ctxs[], int remove_cap, int flags);
 int call_set_ipv4root (unsigned long ip[], int nb,
                       unsigned long bcast, unsigned long mask[]);
@@ -32,6 +39,10 @@ int call_set_ctxlimit (int res, long limit);
 
 void   vserver_init();
 
+  ctx_t                getctx(pid_t pid);
+
+#define getcctx()      (getctx(getpid()))
+
 #ifdef __cplusplus
 }
 #endif