Page 1 of 1

invoking options inside newLISP

Posted: Sat Apr 10, 2010 11:14 pm
by kanen
I would like to be able to programmaticly change certain options, without passing them on the command-line. Am I forced to spawn a new version of newLISP to do this?

For example;

I want to check the amount of memory available for my program, then invoke:

Code: Select all

-s <stacksize>
-m <max-mem-megabyte>
I am also assuming, for a web server, I should simply fork a new instance of newLISP with -http <port> if I want to invoke an http server from within my code?

Re: invoking options inside newLISP

Posted: Sun Apr 11, 2010 7:33 am
by Lutz
Yes, stacksize and max-mem-size can only be changed from the command-line.

NewLISP has a very quick startup time, so I would use the non-blocking 'process' to start a new newLISP-server instance. The 'process' function uses C fork() and execve() internally and also does all the I/O pipe setup necessary. This is how the qa-net test script in newlisp-x.x.x/qa-specific-tests/ was written. Process also returns a a pid, you can use to 'destroy' the process. You also can do your own I/O and error -pipe setup for 'process' if necessary.