pike.git / src / main.c

version» Context lines:

pike.git/src/main.c:1:   /*\   ||| This file a part of Pike, and is copyright by Fredrik Hubinette   ||| Pike is distributed as GPL (General Public License)   ||| See the files COPYING and DISCLAIMER for more information.   \*/   #include "global.h" - RCSID("$Id: main.c,v 1.56 1998/07/27 21:57:11 hubbe Exp $"); + RCSID("$Id: main.c,v 1.57 1998/08/10 23:33:30 hubbe Exp $");   #include "fdlib.h"   #include "backend.h"   #include "module.h"   #include "object.h"   #include "lex.h"   #include "pike_types.h"   #include "builtin_functions.h"   #include "array.h"   #include "stralloc.h"   #include "interpret.h"
pike.git/src/main.c:187:    case 's':    if(!p[1])    {    e++;    if(e >= argc)    {    fprintf(stderr,"Missing argument to -s\n");    exit(1);    }    p=argv[e]; +  }else{ +  p++; +  if(*p=='s') +  { +  if(!p[1]) +  { +  e++; +  if(e >= argc) +  { +  fprintf(stderr,"Missing argument to -ss\n"); +  exit(1);    } -  stack_size=STRTOL(p+1,&p,0); +  p=argv[e]; +  }else{ +  p++; +  } + #ifdef _REENTRANT +  thread_stack_size=STRTOL(p,&p,0); + #endif    p+=strlen(p); -  +  break; +  } +  } +  stack_size=STRTOL(p,&p,0); +  p+=strlen(p);       if(stack_size < 256)    {    fprintf(stderr,"Stack size must at least be 256.\n");    exit(1);    }    break;       case 'q':    if(!p[1])    {    e++;    if(e >= argc)    {    fprintf(stderr,"Missing argument to -q\n");    exit(1);    }    p=argv[e]; -  +  }else{ +  p++;    } -  instructions_left=STRTOL(p+1,&p,0); +  instructions_left=STRTOL(p,&p,0);    p+=strlen(p);    add_to_callback(&evaluator_callbacks,    time_to_exit,    0,0);       break;       case 'd':    more_d_flags:    switch(p[1])
pike.git/src/main.c:292:    }    }else{    break;    }    }      #if !defined(RLIMIT_NOFILE) && defined(RLIMIT_OFILE)   #define RLIMIT_NOFILE RLIMIT_OFILE   #endif    + #if defined(HAVE_GETRLIMIT) && defined(RLIMIT_STACK) +  { +  struct rlimit lim; +  if(!getrlimit(RLIMIT_STACK, &lim)) +  { + #ifdef RLIM_INFINITY +  if(lim.rlim_cur == RLIM_INFINITY) +  lim.rlim_cur=1024*1024*128; + #endif +  stack_top= ((char *) &argv) + +  STACK_DIRECTION * (lim.rlim_cur - 8192 * sizeof(char *)); +  } +  } + #else +  stack_top= ((char *) &argv) + +  STACK_DIRECTION * (1024*1024 * 128 - 8192 * sizeof(char *)); + #endif +    #if defined(HAVE_SETRLIMIT) && defined(RLIMIT_NOFILE)    {    struct rlimit lim;    long tmp;    if(!getrlimit(RLIMIT_NOFILE, &lim))    {   #ifdef RLIM_INFINITY    if(lim.rlim_max == RLIM_INFINITY)    lim.rlim_max=MAX_OPEN_FILEDESCRIPTORS;   #endif