comp.lang.ada
 help / color / mirror / Atom feed
From: "Björn Persson" <bjorn@xn--rombobjrn-67a.se>
Subject: Raising the stack limit (was: segfault with large-ish array with GNAT)
Date: Fri, 07 May 2010 23:58:13 +0200
Date: 2010-05-07T23:58:13+02:00	[thread overview]
Message-ID: <84jgnmFdj5U1@mid.individual.net> (raw)
In-Reply-To: ac4bed10-f655-4fa5-8891-2967ba4388a0@k6g2000prg.googlegroups.com

Jerry wrote:

> ulimit allows querying the hard limit of stack space
>   ulimit -Hs
> which on OS X reports 65532 = 2^16 -4 kilobytes, about 67 MB. The user
> via ulimit can set the stack up to that size but not higher:
>   ulimit -s 65532
> The default soft limit on OS X is 8192 kB, found by
>   ulimit -s

I read this discussion as it happened, and thought it should be possible for 
a program to raise its own soft stack limit up to the hard limit, without a 
shell script wrapper. Today I stumbled on it. The POSIX system calls are 
getrlimit and setrlimit. It should be possible to import them with the usual 
methods for interfacing to C. Try "man 2 setrlimit" on any Unix-like system. 
Maybe this helps someone.

-- 
Bj�rn Persson
PGP key A88682FD



  parent reply	other threads:[~2010-05-07 21:58 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-17 19:21 segfault with large-ish array with GNAT Jerry
2010-03-17 19:36 ` Gautier write-only
2010-03-17 19:58   ` Georg Bauhaus
2010-03-18  6:45     ` Jerry
2010-03-18  7:52       ` Ludovic Brenta
2010-03-18 23:57         ` Robert A Duff
2010-03-18 10:13       ` Jeffrey Creem
2010-03-18 10:23         ` Ludovic Brenta
2010-03-19  0:44           ` Jerry
2010-03-18 19:51         ` Adam Beneschan
2010-03-18 14:44       ` John B. Matthews
2010-03-19  4:44         ` Jeffrey R. Carter
2010-03-19  8:14           ` John B. Matthews
2010-03-18 15:36       ` Gautier write-only
2010-03-18 16:46       ` tmoran
2010-03-18 19:11         ` Warren
2010-03-18 17:03       ` Warren
2010-03-18 20:38         ` Maciej Sobczak
2010-03-19 13:26           ` Charmed Snark
2010-03-19 17:27             ` tmoran
2010-03-19 18:02               ` Simon Wright
2010-03-19 20:10                 ` Warren
2010-03-19 21:50                 ` Adam Beneschan
2010-03-19 20:24               ` Warren
2010-03-19 20:38           ` Warren
2010-03-19  8:31         ` Ludovic Brenta
2010-03-19 13:20           ` Warren
2010-03-19 12:04       ` Brian Drummond
2010-03-19 19:22         ` Jerry
2010-03-19 20:22         ` Jeffrey R. Carter
2010-03-19 23:24           ` Jerry
2010-03-20  0:25             ` Jeffrey R. Carter
2010-05-07 21:58       ` Björn Persson [this message]
2010-03-17 19:57 ` jonathan
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox