1import platform
2
3# Some tests perform deep recursion, which requires a larger pthread stack size
4# than the relatively low default of 192 KiB for 64-bit processes on AIX. The
5# `AIXTHREAD_STK` environment variable provides a non-intrusive way to request
6# a larger pthread stack size for the tests. Various applications and runtime
7# libraries on AIX use a default pthread stack size of 4 MiB, so we will use
8# that as a default value here.
9if 'AIXTHREAD_STK' in os.environ:
10    config.environment['AIXTHREAD_STK'] = os.environ['AIXTHREAD_STK']
11elif platform.system() == 'AIX':
12    config.environment['AIXTHREAD_STK'] = '4194304'
13