From 77d217fe688830898ca2b89ebca32fc30aab0741 Mon Sep 17 00:00:00 2001 From: Enrico Scholz Date: Tue, 30 Dec 2003 13:47:56 +0000 Subject: [PATCH] s!ctx_t!xid_t! git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/branches/SYSCALL_SWITCH@501 94cd875c-1c1d-0410-91d2-eb244daf1a30 --- util-vserver/compat.h | 4 ++-- util-vserver/configure.ac | 2 +- util-vserver/lib/getctx-compat.hc | 2 +- util-vserver/lib/getctx-legacy.hc | 2 +- util-vserver/lib/getctx.c | 2 +- util-vserver/lib/syscall-compat.hc | 2 +- util-vserver/lib/syscall.c | 2 +- util-vserver/lib/syscall_kill-v11.hc | 2 +- util-vserver/lib/syscall_kill.c | 2 +- util-vserver/lib/syscall_rlimit-v11.hc | 6 +++--- util-vserver/lib/syscall_rlimit.c | 6 +++--- util-vserver/lib/vserver-internal.h | 2 +- util-vserver/lib/vserver.h | 18 +++++++++--------- util-vserver/src/vlimit.c | 2 +- 14 files changed, 27 insertions(+), 27 deletions(-) diff --git a/util-vserver/compat.h b/util-vserver/compat.h index 00e687e..8aad852 100644 --- a/util-vserver/compat.h +++ b/util-vserver/compat.h @@ -38,9 +38,9 @@ # define MS_MOVE 8192 #endif -#ifndef HAVE_CTX_T +#ifndef HAVE_XID_T #include -typedef uint32_t ctx_t; +typedef uint32_t xid_t; #endif #endif // H_UTIL_VSERVER_COMPAT_H diff --git a/util-vserver/configure.ac b/util-vserver/configure.ac index 1d0cabe..1a8908c 100644 --- a/util-vserver/configure.ac +++ b/util-vserver/configure.ac @@ -107,7 +107,7 @@ AC_CHECK_HEADERS([ext2fs/ext2fs.h], [], AC_CHECK_FUNCS([sys_virtual_context]) AC_CHECK_DECLS(MS_MOVE,,,[#include ]) -AC_CHECK_TYPES(ctx_t,,,[#include ]) +AC_CHECK_TYPES(xid_t,,,[#include ]) AC_CONFIG_FILES([util-vserver.spec Makefile]) AC_OUTPUT diff --git a/util-vserver/lib/getctx-compat.hc b/util-vserver/lib/getctx-compat.hc index 96de609..e0dfd0b 100644 --- a/util-vserver/lib/getctx-compat.hc +++ b/util-vserver/lib/getctx-compat.hc @@ -21,7 +21,7 @@ #include "getctx-legacy.hc" -static inline ALWAYSINLINE ctx_t +static inline ALWAYSINLINE xid_t vc_X_getctx_compat(pid_t pid) { return vc_X_getctx_legacy(pid); diff --git a/util-vserver/lib/getctx-legacy.hc b/util-vserver/lib/getctx-legacy.hc index a3ac1be..ab1038e 100644 --- a/util-vserver/lib/getctx-legacy.hc +++ b/util-vserver/lib/getctx-legacy.hc @@ -33,7 +33,7 @@ #define CTX_TAG "\ns_context: " -static ctx_t +static xid_t vc_X_getctx_legacy(pid_t pid) { static volatile size_t bufsize=4097; diff --git a/util-vserver/lib/getctx.c b/util-vserver/lib/getctx.c index 20b687c..a4412ae 100644 --- a/util-vserver/lib/getctx.c +++ b/util-vserver/lib/getctx.c @@ -33,7 +33,7 @@ #include -ctx_t +xid_t vc_X_getctx(pid_t pid) { CALL_VC(CALL_VC_COMPAT(vc_X_getctx, pid), diff --git a/util-vserver/lib/syscall-compat.hc b/util-vserver/lib/syscall-compat.hc index ff16b17..fb07d4d 100644 --- a/util-vserver/lib/syscall-compat.hc +++ b/util-vserver/lib/syscall-compat.hc @@ -29,7 +29,7 @@ #include static inline ALWAYSINLINE int -vc_new_s_context_compat(ctx_t ctx, unsigned int remove_cap, unsigned int flags) +vc_new_s_context_compat(xid_t ctx, unsigned int remove_cap, unsigned int flags) { struct vcmd_new_s_context_v1 msg; msg.remove_cap = remove_cap; diff --git a/util-vserver/lib/syscall.c b/util-vserver/lib/syscall.c index ecc6dc6..4088735 100644 --- a/util-vserver/lib/syscall.c +++ b/util-vserver/lib/syscall.c @@ -39,7 +39,7 @@ #if defined(VC_ENABLE_API_COMPAT) || defined(VC_ENABLE_API_LEGACY) int -vc_new_s_context(ctx_t ctx, unsigned int remove_cap, unsigned int flags) +vc_new_s_context(xid_t ctx, unsigned int remove_cap, unsigned int flags) { CALL_VC(CALL_VC_COMPAT(vc_new_s_context, ctx, remove_cap, flags), CALL_VC_LEGACY(vc_new_s_context, ctx, remove_cap, flags)); diff --git a/util-vserver/lib/syscall_kill-v11.hc b/util-vserver/lib/syscall_kill-v11.hc index de1f42d..7422c4f 100644 --- a/util-vserver/lib/syscall_kill-v11.hc +++ b/util-vserver/lib/syscall_kill-v11.hc @@ -21,7 +21,7 @@ #endif static inline ALWAYSINLINE int -vc_ctx_kill_v11(ctx_t ctx, pid_t pid, int sig) +vc_ctx_kill_v11(xid_t ctx, pid_t pid, int sig) { struct vcmd_ctx_kill_v0 param = { .pid = pid, diff --git a/util-vserver/lib/syscall_kill.c b/util-vserver/lib/syscall_kill.c index 32cd73e..c16a5c1 100644 --- a/util-vserver/lib/syscall_kill.c +++ b/util-vserver/lib/syscall_kill.c @@ -30,7 +30,7 @@ #endif int -vc_ctx_kill(ctx_t ctx, pid_t pid, int sig) +vc_ctx_kill(xid_t ctx, pid_t pid, int sig) { CALL_VC(CALL_VC_V11(vc_ctx_kill, ctx, pid, sig)); } diff --git a/util-vserver/lib/syscall_rlimit-v11.hc b/util-vserver/lib/syscall_rlimit-v11.hc index 9140b0e..97889ec 100644 --- a/util-vserver/lib/syscall_rlimit-v11.hc +++ b/util-vserver/lib/syscall_rlimit-v11.hc @@ -29,7 +29,7 @@ ((LIMIT)==VC_LIM_KEEP) ? CRLIM_KEEP : (LIMIT)) static inline ALWAYSINLINE int -vc_get_rlimit_v11(ctx_t ctx, int resource, struct vc_rlimit *lim) +vc_get_rlimit_v11(xid_t ctx, int resource, struct vc_rlimit *lim) { struct vcmd_ctx_rlimit_v0 vc_lim; int rc; @@ -44,7 +44,7 @@ vc_get_rlimit_v11(ctx_t ctx, int resource, struct vc_rlimit *lim) } static inline ALWAYSINLINE int -vc_set_rlimit_v11(ctx_t ctx, int resource, struct vc_rlimit const *lim) +vc_set_rlimit_v11(xid_t ctx, int resource, struct vc_rlimit const *lim) { struct vcmd_ctx_rlimit_v0 vc_lim; @@ -57,7 +57,7 @@ vc_set_rlimit_v11(ctx_t ctx, int resource, struct vc_rlimit const *lim) } static inline ALWAYSINLINE int -vc_get_rlimit_mask_v11(ctx_t ctx, int tmp, struct vc_rlimit_mask *lim) +vc_get_rlimit_mask_v11(xid_t ctx, int tmp, struct vc_rlimit_mask *lim) { struct vcmd_ctx_rlimit_v0 vc_lim; int rc; diff --git a/util-vserver/lib/syscall_rlimit.c b/util-vserver/lib/syscall_rlimit.c index d416e82..e406a46 100644 --- a/util-vserver/lib/syscall_rlimit.c +++ b/util-vserver/lib/syscall_rlimit.c @@ -32,19 +32,19 @@ #if defined (VC_ENABLE_API_V11) int -vc_get_rlimit(ctx_t ctx, int resource, struct vc_rlimit *lim) +vc_get_rlimit(xid_t ctx, int resource, struct vc_rlimit *lim) { CALL_VC(CALL_VC_V11(vc_get_rlimit, ctx, resource, lim)); } int -vc_set_rlimit(ctx_t ctx, int resource, struct vc_rlimit const *lim) +vc_set_rlimit(xid_t ctx, int resource, struct vc_rlimit const *lim) { CALL_VC(CALL_VC_V11(vc_set_rlimit, ctx, resource, lim)); } int -vc_get_rlimit_mask(ctx_t ctx, struct vc_rlimit_mask *lim) +vc_get_rlimit_mask(xid_t ctx, struct vc_rlimit_mask *lim) { CALL_VC(CALL_VC_V11(vc_get_rlimit_mask, ctx, 0, lim)); } diff --git a/util-vserver/lib/vserver-internal.h b/util-vserver/lib/vserver-internal.h index 6215a51..61eacaa 100644 --- a/util-vserver/lib/vserver-internal.h +++ b/util-vserver/lib/vserver-internal.h @@ -73,7 +73,7 @@ #if 1 # define CTX_KERNEL2USER(X) (((X)==(uint32_t)(-1)) ? VC_NOCTX : \ ((X)==(uint32_t)(-2)) ? VC_SAMECTX : \ - (ctx_t)(X)) + (xid_t)(X)) # define CTX_USER2KERNEL(X) (((X)==VC_RANDCTX) ? (uint32_t)(-1) : \ ((X)==VC_SAMECTX) ? (uint32_t)(-2) : \ diff --git a/util-vserver/lib/vserver.h b/util-vserver/lib/vserver.h index 99ac26c..34cf8d4 100644 --- a/util-vserver/lib/vserver.h +++ b/util-vserver/lib/vserver.h @@ -25,11 +25,11 @@ #include /** the value which is returned in error-case (no ctx found) */ -#define VC_NOCTX ((ctx_t)(-1)) +#define VC_NOCTX ((xid_t)(-1)) /** the value which means a random (the next free) ctx */ -#define VC_RANDCTX ((ctx_t)(-1)) +#define VC_RANDCTX ((xid_t)(-1)) /** the value which means the current ctx */ -#define VC_SAMECTX ((ctx_t)(-2)) +#define VC_SAMECTX ((xid_t)(-2)) #define VC_LIM_INFINITY (~0ULL) #define VC_LIM_KEEP (~1ULL) @@ -52,7 +52,7 @@ extern "C" { * - VC_SAMECTX which means the current context (just for changing caps and flags) * - VC_RANDCTX 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); + int vc_new_s_context(xid_t ctx, unsigned int remove_cap, unsigned int flags); /** Sets the ipv4root information. * \precondition: nb<16 */ @@ -76,19 +76,19 @@ extern "C" { 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); + int vc_get_rlimit(xid_t ctx, int resource, struct vc_rlimit *lim); + int vc_set_rlimit(xid_t ctx, int resource, struct vc_rlimit const *lim); + int vc_get_rlimit_mask(xid_t ctx, struct vc_rlimit_mask *lim); /** sends a signal to a context/pid Special values for pid are: * -1 which means every process in ctx except the init-process * 0 which means every process in ctx inclusive the init-process */ - int vc_ctx_kill(ctx_t ctx, pid_t pid, int sig); + int vc_ctx_kill(xid_t ctx, pid_t pid, int sig); /** Returns the context of the given process. pid==0 means the current process. */ - ctx_t vc_X_getctx(pid_t pid); + xid_t vc_X_getctx(pid_t pid); #ifdef __cplusplus } diff --git a/util-vserver/src/vlimit.c b/util-vserver/src/vlimit.c index c00123a..6d0a9da 100644 --- a/util-vserver/src/vlimit.c +++ b/util-vserver/src/vlimit.c @@ -170,7 +170,7 @@ int main (int argc, char *argv[]) int set_mask = 0; struct vc_rlimit limits[32]; bool show_all = false; - ctx_t ctx = -2; + xid_t ctx = VC_SAMECTX; { size_t i; -- 1.8.1.5