case CMD_HELP : showHelp(1, argv[0], 0);
case CMD_VERSION : showVersion();
case CMD_SET : break; // default op currently
- case CMD_XID : args.xid = atoi(optarg); break;
- case CMD_FLAG : parseFlags(optarg, &args.flags); break;
- case CMD_CCAP : parseCCaps(optarg, &args.caps); break;
- case CMD_BCAP : parseBCaps(optarg, &args.caps); break;
- case CMD_SECURE : parseSecure(&args.flags, &args.caps); break;
+ case CMD_XID : args.xid = Evc_xidopt2xid(optarg,true); break;
+ case CMD_FLAG : parseFlags(optarg, &args.flags); break;
+ case CMD_CCAP : parseCCaps(optarg, &args.caps); break;
+ case CMD_BCAP : parseBCaps(optarg, &args.caps); break;
+ case CMD_SECURE : parseSecure(&args.flags, &args.caps); break;
default :
WRITE_MSG(2, "Try '");
WRITE_STR(2, argv[0]);
case CMD_SILENTEXIST : args.is_silentexist = true; break;
case CMD_SYNCSOCK : args.sync_sock = optarg; break;
case CMD_SYNCMSG : args.sync_msg = optarg; break;
- case CMD_XID : args.xid = atol(optarg); break;
- case CMD_UID : args.uid = atol(optarg); break;
+ case CMD_UID : args.uid = atol(optarg); break;
+ case CMD_XID : args.xid = Evc_xidopt2xid(optarg,true); break;
case CMD_SILENT : --args.verbosity; break;
case CMD_MIGRATESELF :
args.do_migrate = true;
case CMD_HELP : showHelp(1, argv[0], 0);
case CMD_VERSION : showVersion();
case CMD_XID :
- case 'c' : ctx = atoi(optarg); break;
- case 'a' : show_all = true; break;
- case 'n' : do_resolve = false; break;
+ case 'a' : show_all = true; break;
+ case 'n' : do_resolve = false; break;
+ case CMD_DIR : dir = optarg; break;
+ case CMD_MISSINGOK: missing_ok = true; break;
+ case 'c' : ctx = Evc_xidopt2xid(optarg,true); break;
case 'd' : fmt_func = utilvserver_fmt_uint64; break;
- case CMD_DIR : dir = optarg; break;
- case CMD_MISSINGOK: missing_ok = true; break;
case 'M' :
case 'S' :
case 'H' :
#define ENSC_WRAPPERS_PREFIX "vnamespace: "
#define ENSC_WRAPPERS_UNISTD 1
+#define ENSC_WRAPPERS_VSERVER 1
#include <wrappers.h>
#ifndef CLONE_NEWNS
case 'n' : do_new = true; break;
case 's' : do_set = true; break;
case 'c' : do_cleanup = true; break;
- case 'e' : do_enter = true; xid = atol(optarg); break;
+ case 'e' :
+ do_enter = true;
+ xid = Evc_xidopt2xid(optarg,true);
+ break;
default :
WRITE_MSG(2, "Try '");
#define ENSC_WRAPPERS_FCNTL 1
#define ENSC_WRAPPERS_IO 1
#define ENSC_WRAPPERS_UNISTD 1
+#define ENSC_WRAPPERS_VSERVER 1
#include <wrappers.h>
typedef enum { tgNONE,tgCONTEXT, tgRUNNING,
{
char const * res = 0;
char buf[sizeof(xid_t)*4 + 1024];
- xid_t xid = *vserver!='\0' ? (xid_t)(atoi(vserver)) : VC_SAMECTX;
+ xid_t xid = *vserver!='\0' ? vc_xidopt2xid(vserver,true,0) : VC_SAMECTX;
memset(buf, 0, sizeof buf);
switch (tag) {
}
}
-static xid_t
-str2xid(char const *str)
-{
- if (strcmp(str,"self")==0) return Evc_get_task_xid(0);
- else return atoi(str);
-}
-
static size_t
findUtsIdx(char const *str, size_t len)
{
case CMD_MISSINGOK: args.is_missingok = true; break;
case 'g' : args.do_set = false; break;
case 's' : args.do_set = true; break;
- case 'x' : args.xid = str2xid(optarg); break;
- case 't' : registerValue(optarg, args.tags); break;
+ case 'x' : args.xid = Evc_xidopt2xid(optarg,true); break;
+ case 't' : registerValue(optarg, args.tags); break;
default :
WRITE_MSG(2, "Try '");
WRITE_STR(2, argv[0]);