From 48f5cadcdeb0ee56a0faab35a63aa58d5cec4f2f Mon Sep 17 00:00:00 2001 From: Enrico Scholz Date: Fri, 7 Nov 2003 22:00:17 +0000 Subject: [PATCH] added limit stuff git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/branches/SYSCALL_SWITCH@384 94cd875c-1c1d-0410-91d2-eb244daf1a30 --- util-vserver/lib/vserver.h | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/util-vserver/lib/vserver.h b/util-vserver/lib/vserver.h index e776f09..65798e7 100644 --- a/util-vserver/lib/vserver.h +++ b/util-vserver/lib/vserver.h @@ -23,7 +23,9 @@ #include #include -#define VC_NOCTX ((ctx_t)(-1)) +#define VC_NOCTX ((ctx_t)(-1)) +#define VC_LIM_INFINITY (~0ULL) +#define VC_LIM_KEEP (~1ULL) #ifdef __cplusplus extern "C" { @@ -52,6 +54,27 @@ extern "C" { int vc_chrootsafe(char const *dir); + /* rlimit related functions */ + typedef uint64_t vc_limit_t; + + + struct vc_rlimit + { + vc_limit_t min; + vc_limit_t soft; + vc_limit_t hard; + }; + + struct vc_rlimit_mask { + uint32_t min; + uint32_t soft; + uint32_t hard; + }; + + int vc_get_rlimit(ctx_t ctx, int resource, struct vc_rlimit *lim); + int vc_set_rlimit(ctx_t ctx, int resource, struct vc_rlimit const *lim); + int vc_get_rlimit_mask(ctx_t ctx, struct vc_rlimit_mask *lim); + /** Returns the context of the given process. pid==0 means the current process. */ ctx_t vc_X_getctx(pid_t pid); -- 1.8.1.5