#include <unistd.h>
#include <ctype.h>
#include <sys/resource.h>
+#include <sys/types.h>
#include <fcntl.h>
#define _GNU_SOURCE
#include <sched.h>
#include "vserver.h"
#include "planetlab.h"
+/* defined in netns.c */
+extern uint32_t get_space_flag(xid_t);
+
#ifndef VC_NXC_RAW_SOCKET
# define VC_NXC_RAW_SOCKET 0x00000200ull
#endif
if (vc_tag_create(ctx) == VC_NOCTX)
return -1;
-process:
-
/*
* Create context info - this sets the STATE_SETUP and STATE_INIT flags.
*/
buf[len-1]='\0';
len --;
}
- if ( (r->type == TYPE_LONG) && isdigit(*buf)) {
- *r->limit = atoi(buf);
+ if (r->type == TYPE_LONG) {
+ int val;
+ char *res=0;
+ errno=0;
+ val = strtol(buf,&res,0);
+ if ( !( (val==0 && res) || (errno!=0) ) )
+ *r->limit = val;
} else if ( (r->type == TYPE_PERS) && isalpha(*buf)) {
unsigned long int res;
res = vc_str2personalitytype(buf,len);
fclose(fb);
}
- fchdir(cwd);
+ (void)fchdir(cwd);
out_fd:
close(cwd);
out: