From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,ae395e5c11de7bc9 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!nntp.club.cc.cmu.edu!feeder.erje.net!news-1.dfn.de!news.dfn.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: =?ISO-8859-1?Q?Bj=F6rn?= Persson Newsgroups: comp.lang.ada Subject: Raising the stack limit (was: segfault with large-ish array with GNAT) Followup-To: comp.lang.ada Date: Fri, 07 May 2010 23:58:13 +0200 Message-ID: <84jgnmFdj5U1@mid.individual.net> References: <642ddf8b-1d45-4f74-83ad-2c755040ca33@k24g2000pro.googlegroups.com> <4ba13454$0$6720$9b4e6d93@newsspool2.arcor-online.net> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8Bit X-Trace: individual.net QGKix5OXnVmjpP5PKsTVxAtEhXzxk+k46rvI2ekXOFfl0dA9om Cancel-Lock: sha1:2kdSflpsy7nqJ2pTr2HU7D6uniQ= User-Agent: KNode/4.4.2 Xref: g2news2.google.com comp.lang.ada:11403 Date: 2010-05-07T23:58:13+02:00 List-Id: 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