1 |
/* |
2 |
* $Header: /u/gcmpack/MITgcm/eesupp/src/setrlstk.c,v 1.1 2005/09/11 18:52:26 edhill Exp $ |
3 |
* $Name: $ |
4 |
|
5 |
//BOP |
6 |
// !ROUTINE: setrlstk |
7 |
// !INTERFACE: |
8 |
setrlstk() |
9 |
|
10 |
// !DESCRIPTION: |
11 |
// Unlimit the size of the stack using setrlimit(). |
12 |
|
13 |
//EOP |
14 |
|
15 |
*/ |
16 |
|
17 |
/* Here, we get the definition of the FC_NAMEMANGLE() macro. */ |
18 |
#include "FC_NAMEMANGLE.h" |
19 |
|
20 |
/* #define FC_NAMEMANGLE(X) X ## _ */ |
21 |
#ifdef HAVE_SETRLSTK |
22 |
#include <sys/time.h> |
23 |
#include <sys/resource.h> |
24 |
#include <unistd.h> |
25 |
#endif |
26 |
|
27 |
/* int main( int argc, char ** argv ) */ |
28 |
void FC_NAMEMANGLE(setrlstk) () |
29 |
{ |
30 |
#ifdef HAVE_SETRLSTK |
31 |
struct rlimit rls; |
32 |
|
33 |
rls.rlim_cur = RLIM_INFINITY; |
34 |
rls.rlim_max = RLIM_INFINITY; |
35 |
setrlimit(RLIMIT_STACK, &rls); |
36 |
/* system("ulimit -a"); */ |
37 |
#endif |
38 |
return; |
39 |
} |
40 |
|
41 |
|