From: Enrico Scholz Date: Tue, 14 Oct 2003 15:22:20 +0000 (+0000) Subject: added some documentation X-Git-Tag: version_0_23_96~33 X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=12499d4390147b3c0b1e7be25247e036bf1093bd;p=util-vserver.git added some documentation added vc_X_getctx() (pseudo-)syscall git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/branches/SYSCALL_SWITCH@145 94cd875c-1c1d-0410-91d2-eb244daf1a30 --- diff --git a/util-vserver/lib/vserver.h b/util-vserver/lib/vserver.h index 46c2b1a..e476f4d 100644 --- a/util-vserver/lib/vserver.h +++ b/util-vserver/lib/vserver.h @@ -21,6 +21,9 @@ #include #include +#include + +#define VC_NOCTX ((ctx_t)(-1)) #ifdef __cplusplus extern "C" { @@ -31,11 +34,30 @@ extern "C" { uint32_t mask; }; - int vc_get_version(int cat); + /** Returns version of the given API-category */ + int vc_get_version(int category); + + /** Puts current process into context , removes the given caps and + * sets flags. + * Special values for ctx are + * - -2 which means the current context (just for changing caps and flags) + * - -1 which means the next free context; this value can be used by + * ordinary users also */ int vc_new_s_context(ctx_t ctx, unsigned int remove_cap, unsigned int flags); + + /** Sets the ipv4root information. + * \precondition: nb<16 */ int vc_set_ipv4root(uint32_t bcast, size_t nb, struct vc_ip_mask_pair const *ips); + int vc_chrootsafe(char const *dir); + + /** Returns the context of the given process. */ + ctx_t vc_X_getctx(pid_t pid); + + /** Returns the context of the current process. */ +#define vc_X_getcctx (getctx(getpid())) + #ifdef __cplusplus } #endif