access bash from C program?

Thomas Charron twaffle at gmail.com
Mon Jun 2 14:26:43 EDT 2008


On 6/2/08, Labitt, Bruce <labittb1 at tycoelectronics.com> wrote:
> 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,

  Yes.  ulimit will change the current process, as well as any future
children.  Bear in mind however, you MUST be root in order for this to
work.  Only root is allowed to change the hard limit.  Anyone can
change their soft limit, but not higher then the hard limit.  hard
limits are reserved for root.

-- 
-- Thomas


More information about the gnhlug-discuss mailing list