From:	CRDGW2::CRDGW2::MRGATE::"SMTP::CRVAX.SRI.COM::RELAY-INFO-VAX" 15-SEP-1990 03:14:28.30
To:	MRGATE::"ARISIA::EVERHART"
CC:	
Subj:	re: getting sysgen parameters from c

Received:  by crdgw1.ge.com (5.57/GE 1.73)
	 id AA27926; Sat, 15 Sep 90 00:16:34 EDT
Received: From UCBVAX.BERKELEY.EDU by CRVAX.SRI.COM with TCP; Fri, 14 SEP 90 11:44:58 PDT
Received: by ucbvax.Berkeley.EDU (5.63/1.42)
	id AA16147; Fri, 14 Sep 90 11:32:39 -0700
Received: from USENET by ucbvax.Berkeley.EDU with netnews
	for info-vax@kl.sri.com (info-vax@kl.sri.com)
	(contact usenet@ucbvax.Berkeley.EDU if you have questions)
Date: 14 Sep 90 17:53:50 GMT
From: agate!shelby!csli!cower@ucbvax.Berkeley.EDU  (Richard Cower)
Organization: Center for the Study of Language and Information, Stanford U.
Subject: re: getting sysgen parameters from c
Message-Id: <15335@csli.Stanford.EDU>
Sender: info-vax-request@kl.sri.com
To: info-vax@kl.sri.com

Someone asked about how to see sysgen parameters from a program.
Here is a little c program that goes one step further, it lets you
change (non-dynamic) parameters. In this example, it alters FREELIM.

This is strictly USE AT YOUR OWN RISK. It's been about 9 months since
I fiddled with this, but I think it was last run on a 5-3.1 system.


Rich Cower, cower@netman.intel.com


/* Hack to see if this could be done.
*
*   link 'p1',sys$system:sys.stb/selective,sys$input/option
*   sys$library:vaxcrtl/share
*
*/

#include ssdef

globalvalue SGN$GL_FREELIM;

int modify (int);
int args[] = {1,0};

main ()
	{
	int free;
	int status;
	
	printf ("Current FREELIM = %d\n",*((int *) SGN$GL_FREELIM));
	
	printf ("Enter new value for FREELIM: ");
	scanf ("%d",&free);
	args[1] = free;
	
	status = sys$cmkrnl (modify,args);
	if (status != SS$_NORMAL) lib$signal (status);
	
	printf ("FREELIM changed to %d\n",*((int *) SGN$GL_FREELIM));
	}
	
int modify (int FREELIM)
	{
	*((int *) SGN$GL_FREELIM) = freelim;
	return (SS$_NORMAL);
	}
	
	

