--- /dev/null
+// $Id$ --*- c -*--
+
+// Copyright (C) 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
+//
+// 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
+
+inline static ALWAYSINLINE int
+vc_get_iattr_compat_v13(char const UNUSED *filename, dev_t dev, ino_t ino,
+ xid_t *xid, uint32_t *flags, uint32_t *mask)
+{
+ return vc_get_iattr(dev, ino, xid, flags, mask);
+}
--- /dev/null
+// $Id$ --*- c -*--
+
+// Copyright (C) 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
+//
+// 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
+
+inline static ALWAYSINLINE int
+vc_set_iattr_compat_v13(char const UNUSED *filename,
+ dev_t dev, ino_t ino, xid_t xid,
+ uint32_t flags, uint32_t mask)
+{
+ return vc_set_iattr(dev, ino, xid, flags, mask);
+}
--- /dev/null
+// $Id$ --*- c -*--
+
+// Copyright (C) 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
+//
+// 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
+
+#include "utils-legacy.h"
+
+static xid_t
+getctx_legacy_internal(pid_t pid)
+{
+ size_t bufsize = utilvserver_getProcEntryBufsize();
+ char buf[bufsize];
+ char *pos = 0;
+
+ pos = utilvserver_getProcEntry(pid, "\ns_context: ", buf, bufsize);
+
+ if (pos!=0) return atoi(pos);
+ else return VC_NOCTX;
+}
+
+static inline ALWAYSINLINE xid_t
+vc_get_task_xid_X(pid_t pid)
+{
+ xid_t res;
+ do {
+ res = getctx_legacy_internal(pid);
+ } while (res==VC_NOCTX && errno==EAGAIN);
+
+ return res;
+}
--- /dev/null
+// $Id$ --*- c -*--
+
+// Copyright (C) 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
+//
+// 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 xid_t
+vc_get_task_xid_v13(pid_t pid)
+{
+ xid_t res;
+ if (vserver(VC_CMD(VINFO, 1,0), pid, &res)==-1) return -1;
+ return CTX_KERNEL2USER(res);
+}
--- /dev/null
+// $Id$ --*- c -*--
+
+// Copyright (C) 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
+//
+// 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
+
+#include "vserver.h"
+#include "linuxvirtual.h"
+
+#if defined(VC_ENABLE_API_OLDPROC) && defined(VC_ENABLE_API_V13)
+# define VC_MULTIVERSION_SYSCALL 1
+#endif
+#include "vserver-internal.h"
+
+#ifdef VC_ENABLE_API_V13
+# include "syscall_gettaskxid-v13.hc"
+#endif
+
+#ifdef VC_ENABLE_API_OLDPROC
+# include "syscall_gettaskxid-oldproc.hc"
+#endif
+
+xid_t
+vc_get_task_xid(pid_t pid)
+{
+ CALL_VC(CALL_VC_V13 (vc_get_task_xid, pid),
+ CALL_VC_OLDPROC(vc_get_task_xid, pid));
+}
--- /dev/null
+// $Id$ --*- c -*--
+
+// Copyright (C) 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
+//
+// 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 int
+vc_get_vx_info_X(xid_t UNUSED xid, struct vc_vx_info UNUSED *info)
+{
+ // TODO: ???
+ errno = EINVAL;
+ return -1;
+}
--- /dev/null
+// $Id$ --*- c -*--
+
+// Copyright (C) 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
+//
+// 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 int
+vc_get_vx_info_v13(xid_t xid, struct vc_vx_info *info)
+{
+ struct vcmd_vx_info_v0 res;
+ int rc = vserver(VC_CMD(VINFO, 5,0), xid, &res);
+ if (rc==-1) return -1;
+
+ info->xid = CTX_KERNEL2USER(res.xid);
+ info->initpid = res.initpid;
+
+ return rc;
+}
--- /dev/null
+// $Id$ --*- c -*--
+
+// Copyright (C) 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
+//
+// 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
+
+#include "vserver.h"
+#include "linuxvirtual.h"
+
+#if defined(VC_ENABLE_API_OLDPROC) && defined(VC_ENABLE_API_V13)
+# define VC_MULTIVERSION_SYSCALL 1
+#endif
+#include "vserver-internal.h"
+
+#ifdef VC_ENABLE_API_V13
+# include "syscall_getvxinfo-v13.hc"
+#endif
+
+#ifdef VC_ENABLE_API_OLDPROC
+# include "syscall_getvxinfo-oldproc.hc"
+#endif
+
+int
+vc_get_vx_info(xid_t xid, struct vc_vx_info *info)
+{
+ if (info==0) {
+ errno = EINVAL;
+ return -1;
+ }
+ CALL_VC(CALL_VC_V13 (vc_get_vx_info, xid, info),
+ CALL_VC_OLDPROC(vc_get_vx_info, xid, info));
+}