That is what I do now.  I was wondering if there was a programmatic or
more elegant way...

The way that has been suggested would be roughly

        a=getrlimit;  //save current setting
        ulimit    // do what I want
        setrlimit=a       // restore setting

?
Thanks,
-Bruce

-----Original Message-----
From: David J Berube [mailto:[EMAIL PROTECTED] 
Sent: Monday, June 02, 2008 11:55 AM
To: Thomas Charron
Cc: Labitt, Bruce; Greater NH Linux User Group
Subject: Re: access bash from C program?

Come to think of it, it'd probably just be easier to run ulimit before 
you run the C program.

David Berube
Berube Consulting
[EMAIL PROTECTED]
(603)-485-9622
http://www.berubeconsulting.com/

Thomas Charron wrote:
> On 6/2/08, Labitt, Bruce <[EMAIL PROTECTED]> wrote:
>> I've been scratching my brains here a bit.  Is there an easy way to
get
>> access to the shell (bash) from within a C program?  I left my K&R at
>> home...
>> My googling has not particularly enlightened me, either...
>> I'd like to run the equivalent of the command "$ ulimit -s hard"
>> I need to do this because I need much more stack than the terminal
>> window ordinarily allows.  (Can't run FFTs > 256K without above
>> command.)
> 
>   See the ulimit() function?  Or getrlimit() and setrlimit()?
> 

_______________________________________________
gnhlug-discuss mailing list
gnhlug-discuss@mail.gnhlug.org
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/

Reply via email to