sys_getrlimit: modified to return mcexec's RLIMIT_STACK
This commit is contained in:
@ -491,6 +491,8 @@ int main(int argc, char **argv)
|
||||
FILE *interp = NULL;
|
||||
char *interp_path;
|
||||
char *path;
|
||||
int error;
|
||||
struct rlimit rlim_stack;
|
||||
|
||||
#ifdef USE_SYSCALL_MOD_CALL
|
||||
__glob_argc = argc;
|
||||
@ -502,6 +504,12 @@ int main(int argc, char **argv)
|
||||
altroot = "/usr/linux-k1om-4.7/linux-k1om";
|
||||
}
|
||||
|
||||
error = getrlimit(RLIMIT_STACK, &rlim_stack);
|
||||
if (error) {
|
||||
fprintf(stderr, "Error: Failed to get stack limit.\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
strcpy(dev, "/dev/mcos0");
|
||||
if(argv[1]){
|
||||
for(p = argv[1]; *p && *p >= '0' && *p <= '9'; p++);
|
||||
@ -562,6 +570,9 @@ int main(int argc, char **argv)
|
||||
desc->args = args;
|
||||
//print_flat(args);
|
||||
|
||||
desc->rlimit_stack_cur = rlim_stack.rlim_cur;
|
||||
desc->rlimit_stack_max = rlim_stack.rlim_max;
|
||||
|
||||
fd = open(dev, O_RDWR);
|
||||
if (fd < 0) {
|
||||
fprintf(stderr, "Error: Failed to open %s.\n", dev);
|
||||
|
||||
Reference in New Issue
Block a user