X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=ensc_wrappers%2Fwrappers-vserver.hc;fp=ensc_wrappers%2Fwrappers-vserver.hc;h=0000000000000000000000000000000000000000;hb=db5ef3f969fc6ad34aeb5903e44d0049b2e50791;hp=01fe5476d9bf1179c0b1d199514b49fdf80ffa9f;hpb=95e2774070e989fe9cf9f48dae5fa054e55e2a3e;p=util-vserver.git diff --git a/ensc_wrappers/wrappers-vserver.hc b/ensc_wrappers/wrappers-vserver.hc deleted file mode 100644 index 01fe547..0000000 --- a/ensc_wrappers/wrappers-vserver.hc +++ /dev/null @@ -1,208 +0,0 @@ -// $Id: wrappers-vserver.hc 2589 2007-08-16 03:06:50Z dhozac $ --*- c++ -*-- - -// Copyright (C) 2004 Enrico Scholz -// -// 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. - - -#ifndef H_ENSC_IN_WRAPPERS_H -# error wrappers_handler.hc can not be used in this way -#endif - -#if defined(VC_ENABLE_API_COMPAT) || defined(VC_ENABLE_API_LEGACY) - -inline static WRAPPER_DECL xid_t -Evc_new_s_context(xid_t ctx, unsigned int remove_cap, unsigned int flags) -{ - register xid_t res = vc_new_s_context(ctx,remove_cap,flags); - FatalErrnoError(res==VC_NOCTX, "vc_new_s_context()"); - return res; -} - -#endif - -inline static WRAPPER_DECL xid_t -Evc_get_task_xid(pid_t pid) -{ - register xid_t res = vc_get_task_xid(pid); - FatalErrnoError(res==VC_NOCTX, "vc_get_task_xid()"); - return res; -} - -inline static WRAPPER_DECL nid_t -Evc_get_task_nid(pid_t pid) -{ - register nid_t res = vc_get_task_nid(pid); - FatalErrnoError(res==VC_NOCTX, "vc_get_task_nid()"); - return res; -} - -inline static WRAPPER_DECL xid_t -Evc_ctx_create(xid_t xid, struct vc_ctx_flags *flags) -{ - register xid_t res = vc_ctx_create(xid, flags); - FatalErrnoError(res==VC_NOCTX, "vc_ctx_create()"); - return res; -} - -inline static WRAPPER_DECL nid_t -Evc_net_create(nid_t nid) -{ - register nid_t res = vc_net_create(nid); - FatalErrnoError(res==VC_NOCTX, "vc_net_create()"); - return res; -} - -inline static WRAPPER_DECL tag_t -Evc_tag_create(tag_t tag) -{ - register tag_t res = vc_tag_create(tag); - FatalErrnoError(res==VC_NOCTX, "vc_tag_create()"); - return res; -} - -inline static WRAPPER_DECL void -Evc_ctx_migrate(xid_t xid, uint_least64_t flags) -{ - FatalErrnoError(vc_ctx_migrate(xid, flags)==-1, "vc_ctx_migrate()"); -} - -inline static WRAPPER_DECL void -Evc_net_migrate(nid_t nid) -{ - FatalErrnoError(vc_net_migrate(nid)==-1, "vc_net_migrate()"); -} - -inline static WRAPPER_DECL void -Evc_tag_migrate(tag_t tag) -{ - FatalErrnoError(vc_tag_migrate(tag)==-1, "vc_tag_migrate()"); -} - -inline static WRAPPER_DECL void -Evc_get_cflags(xid_t xid, struct vc_ctx_flags *flags) -{ - FatalErrnoError(vc_get_cflags(xid, flags)==-1, "vc_get_cflags()"); -} - -inline static WRAPPER_DECL void -Evc_set_cflags(xid_t xid, struct vc_ctx_flags const *flags) -{ - FatalErrnoError(vc_set_cflags(xid, flags)==-1, "vc_set_cflags()"); -} - -inline static WRAPPER_DECL void -Evc_get_nflags(nid_t nid, struct vc_net_flags *flags) -{ - FatalErrnoError(vc_get_nflags(nid, flags)==-1, "vc_get_nflags()"); -} - -inline static WRAPPER_DECL void -Evc_set_nflags(nid_t nid, struct vc_net_flags const *flags) -{ - FatalErrnoError(vc_set_nflags(nid, flags)==-1, "vc_set_nflags()"); -} - -inline static WRAPPER_DECL void -Evc_set_vhi_name(xid_t xid, vc_uts_type type, - char const *val, size_t len) -{ - FatalErrnoError(vc_set_vhi_name(xid,type,val,len)==-1, "vc_set_vhi_name()"); -} - -inline static WRAPPER_DECL void -Evc_get_ccaps(xid_t xid, struct vc_ctx_caps *caps) -{ - FatalErrnoError(vc_get_ccaps(xid, caps)==-1, "vc_get_ccaps()"); -} - -inline static WRAPPER_DECL void -Evc_set_ccaps(xid_t xid, struct vc_ctx_caps const *caps) -{ - FatalErrnoError(vc_set_ccaps(xid, caps)==-1, "vc_set_ccaps()"); -} - -inline static WRAPPER_DECL void -Evc_get_ncaps(nid_t nid, struct vc_net_caps *caps) -{ - FatalErrnoError(vc_get_ncaps(nid, caps)==-1, "vc_get_ncaps()"); -} - -inline static WRAPPER_DECL void -Evc_set_ncaps(nid_t nid, struct vc_net_caps const *caps) -{ - FatalErrnoError(vc_set_ncaps(nid, caps)==-1, "vc_set_ncaps()"); -} - -inline static WRAPPER_DECL void -Evc_set_namespace(xid_t xid, uint_least64_t mask) -{ - FatalErrnoError(vc_set_namespace(xid, mask)==-1, "vc_set_namespace()"); -} - -inline static WRAPPER_DECL void -Evc_enter_namespace(xid_t xid, uint_least64_t mask) -{ - FatalErrnoError(vc_enter_namespace(xid, mask)==-1, "vc_enter_namespace()"); -} - -inline static WRAPPER_DECL xid_t -Evc_xidopt2xid(char const *id, bool honor_static) -{ - char const * err; - xid_t rc = vc_xidopt2xid(id, honor_static, &err); - if (__builtin_expect(rc==VC_NOCTX,0)) { - ENSC_DETAIL1(msg, "vc_xidopt2xid", id, 1); -#if 1 - FatalErrnoErrorFail(msg); -#else - { - size_t l1 = strlen(msg); - size_t l2 = strlen(err); - char buf[l1 + l2 + sizeof(": ")]; - memcpy(buf, msg, l1); - memcpy(buf+l1, ": ", 2); - memcpy(buf+l1+2, err, l2+1); - - FatalErrnoErrorFail(buf); - } -#endif - } - - return rc; -} - -inline static WRAPPER_DECL nid_t -Evc_nidopt2nid(char const *id, bool honor_static) -{ - char const * err; - nid_t rc = vc_nidopt2nid(id, honor_static, &err); - if (__builtin_expect(rc==VC_NOCTX,0)) { - ENSC_DETAIL1(msg, "vc_nidopt2nid", id, 1); - FatalErrnoErrorFail(msg); - } - return rc; -} - -inline static WRAPPER_DECL tag_t -Evc_tagopt2tag(char const *id, bool honor_static) -{ - char const * err; - tag_t rc = vc_tagopt2tag(id, honor_static, &err); - if (__builtin_expect(rc==VC_NOCTX,0)) { - ENSC_DETAIL1(msg, "vc_tagopt2tag", id, 1); - FatalErrnoErrorFail(msg); - } - return rc; -}