#!/bin/bash
# Daniel R. Roe
# 2010-04-02
# Certain tests require a stack that is at least 20480 kbytes.
# Check the current stack limit, then resize if necessary.
# Return 1 on failure, 0 on success.
STACK=`ulimit -s`
if [[ $STACK -lt 20480 ]] ; then
  echo "This test requires a larger stack size; resizing." > /dev/stderr
  ulimit -s 20480
  STACK=`ulimit -s`
  if [[ $STACK -lt 20480 ]] ; then
    echo "Could not resize the stack." > /dev/stderr
    echo 1
    exit 1
  fi
fi
echo 0
exit 0    
