2002-08-01 06:51:34 -07:00
|
|
|
/***********************************************************************/
|
|
|
|
/* */
|
|
|
|
/* Objective Caml */
|
|
|
|
/* */
|
|
|
|
/* Damien Doligez, projet Moscova, INRIA Rocquencourt */
|
|
|
|
/* */
|
|
|
|
/* Copyright 2002 Institut National de Recherche en Informatique et */
|
|
|
|
/* en Automatique. All rights reserved. This file is distributed */
|
|
|
|
/* under the terms of the GNU Library General Public License, with */
|
|
|
|
/* the special exception on linking described in file ../../LICENSE. */
|
|
|
|
/* */
|
|
|
|
/***********************************************************************/
|
|
|
|
|
|
|
|
/* $Id$ */
|
|
|
|
|
|
|
|
#include <stdio.h>
|
2006-04-16 16:28:22 -07:00
|
|
|
#include <stdlib.h>
|
2002-08-01 06:51:34 -07:00
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/time.h>
|
|
|
|
#include <sys/resource.h>
|
|
|
|
|
2002-08-09 04:10:34 -07:00
|
|
|
#define MINSTACKBYTES (384 * 1024 * sizeof (long))
|
2002-08-01 06:51:34 -07:00
|
|
|
|
|
|
|
int main(int argc, char ** argv)
|
|
|
|
{
|
|
|
|
struct rlimit limit;
|
|
|
|
int rc;
|
|
|
|
|
|
|
|
rc = getrlimit (RLIMIT_STACK, &limit);
|
|
|
|
if (rc != 0) exit (0);
|
|
|
|
if (limit.rlim_cur < MINSTACKBYTES){
|
|
|
|
fprintf (stderr,
|
|
|
|
"\nThe current stack size limit is too low (%luk)\n"
|
|
|
|
"You must increase it with one of the following commands:\n"
|
|
|
|
"Under sh, bash, zsh: ulimit -s %lu\n"
|
|
|
|
"Under csh, tcsh: limit stacksize %lu\n\n",
|
|
|
|
(unsigned long) (limit.rlim_cur / 1024),
|
2010-02-09 06:48:28 -08:00
|
|
|
(unsigned long) (MINSTACKBYTES / 1024),
|
|
|
|
(unsigned long) (MINSTACKBYTES / 1024));
|
2002-08-01 06:51:34 -07:00
|
|
|
exit (3);
|
|
|
|
}
|
|
|
|
exit (0);
|
|
|
|
}
|