#define VCMD_set_space_v1 VC_CMD(PROCALT, 3, 1)
#define VCMD_set_space VC_CMD(PROCALT, 3, 2)
-#define VCMD_get_space_mask VC_CMD(PROCALT, 4, 0)
+#define VCMD_get_space_mask_v0 VC_CMD(PROCALT, 4, 0)
-#define VCMD_get_space_default VC_CMD(PROCALT, 7, 0)
+#define VCMD_get_space_mask VC_CMD(VSPACE, 0, 1)
+#define VCMD_get_space_default VC_CMD(VSPACE, 1, 0)
struct vcmd_space_mask_v1 {
CPU | |VPROC |PROCALT|PROCMIG|PROCTRL| | |SCHED. | |
PROCESS| 08| 09| 10| 11| 12| 13| | 14| 15|
-------+-------+-------+-------+-------+-------+-------+ +-------+-------+
- MEMORY | | | | | | | |SWAP | |
+ MEMORY | | | | |MEMCTRL| | |SWAP | |
| 16| 17| 18| 19| 20| 21| | 22| 23|
-------+-------+-------+-------+-------+-------+-------+ +-------+-------+
NETWORK| |VNET |NETALT |NETMIG |NETCTL | | |SERIAL | |
OTHER |VSTAT | | | | | | |VINFO | |
| 40| 41| 42| 43| 44| 45| | 46| 47|
=======+=======+=======+=======+=======+=======+=======+ +=======+=======+
- SPECIAL|EVENT | | | |FLAGS | | | | |
+ SPECIAL|EVENT | | | |FLAGS | | |VSPACE | |
| 48| 49| 50| 51| 52| 53| | 54| 55|
-------+-------+-------+-------+-------+-------+-------+ +-------+-------+
SPECIAL|DEBUG | | | |RLIMIT |SYSCALL| | |COMPAT |
#define VC_CAT_PROCTRL 12
#define VC_CAT_SCHED 14
-
#define VC_CAT_MEMCTRL 20
#define VC_CAT_VNET 25
#define VC_CAT_EVENT 48
#define VC_CAT_FLAGS 52
+#define VC_CAT_VSPACE 54
#define VC_CAT_DEBUG 56
#define VC_CAT_RLIMIT 60
vc_get_space_mask_spaces(int UNUSED tmp)
{
struct vcmd_space_mask_v1 data = { .mask = 0 };
- int ret = vserver(VCMD_get_space_mask, 0, &data);
+ int ret = vserver(VCMD_get_space_mask_v0, 0, &data);
if (ret)
return ret;
return data.mask & ~(CLONE_NEWNS|CLONE_FS);
--- /dev/null
+// $Id$ --*- c -*--
+
+// Copyright (C) 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
+// Copyright (C) 2006 Daniel Hokka Zakrisson
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; version 2 of the License.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+static inline ALWAYSINLINE uint_least64_t
+vc_get_space_mask_v23(int UNUSED tmp)
+{
+ struct vcmd_space_mask_v1 data = { .mask = 0 };
+ int ret = vserver(VCMD_get_space_mask, 0, &data);
+ if (ret)
+ return ret;
+ return data.mask & ~(CLONE_NEWNS|CLONE_FS);
+}
#endif
#include "vserver.h"
-#include "vserver-internal.h"
#include "virtual.h"
+#if defined(VC_ENABLE_API_V21) && defined(VC_ENABLE_API_V23)
+# define VC_MULTIVERSION_SYSCALL 1
+#endif
+#include "vserver-internal.h"
+
#if defined(VC_ENABLE_API_V21)
# include "syscall_getspacemask-v21.hc"
#endif
-#if defined(VC_ENABLE_API_V21)
+#if defined(VC_ENABLE_API_V23)
+# include "syscall_getspacemask-v23.hc"
+#endif
+
+#if defined(VC_ENABLE_API_V21) || defined(VC_ENABLE_API_V23)
uint_least64_t
vc_get_space_mask()
{
- CALL_VC(CALL_VC_SPACES(vc_get_space_mask, 0));
+ CALL_VC(CALL_VC_V23P (vc_get_space_mask, 0),
+ CALL_VC_SPACES(vc_get_space_mask, 0));
}
#endif