access bash from C program?

Bruce Dawson jbd at codemeta.com
Mon Jun 2 12:13:21 EDT 2008


One usually uses the 'system(3)' function to execute shell commands.

However, this probably won't work in your case because executing 'ulimit
-s hard', will be executed in a subshell (because the system function
works this way).

You will have to use the ulimit function to change it for the current
process.

--Bruce

Labitt, Bruce 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.)
>
> TIA
> -Bruce
>
> _______________________________________________
> gnhlug-discuss mailing list
> gnhlug-discuss at mail.gnhlug.org
> http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/
>   



More information about the gnhlug-discuss mailing list