| @@ -104,6 +104,8 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||||
| #include <errno.h> | #include <errno.h> | ||||
| #include <linux/unistd.h> | #include <linux/unistd.h> | ||||
| #include <sys/syscall.h> | #include <sys/syscall.h> | ||||
| #include <sys/time.h> | |||||
| #include <sys/resource.h> | |||||
| #endif | #endif | ||||
| #if defined(OS_FREEBSD) || defined(OS_DARWIN) | #if defined(OS_FREEBSD) || defined(OS_DARWIN) | ||||
| @@ -1361,6 +1363,18 @@ void CONSTRUCTOR gotoblas_init(void) { | |||||
| gotoblas_memory_init(); | gotoblas_memory_init(); | ||||
| #endif | #endif | ||||
| #if defined(OS_LINUX) | |||||
| struct rlimit curlimit; | |||||
| if ( getrlimit(RLIMIT_STACK, &curlimit ) == 0 ) | |||||
| { | |||||
| if ( curlimit.rlim_cur != curlimit.rlim_max ) | |||||
| { | |||||
| curlimit.rlim_cur = curlimit.rlim_max; | |||||
| setrlimit(RLIMIT_STACK, &curlimit); | |||||
| } | |||||
| } | |||||
| #endif | |||||
| #ifdef SMP | #ifdef SMP | ||||
| if (blas_cpu_number == 0) blas_get_cpu_number(); | if (blas_cpu_number == 0) blas_get_cpu_number(); | ||||
| #ifdef SMP_SERVER | #ifdef SMP_SERVER | ||||