From: Shawn Hargreaves Newsgroups: comp.os.msdos.djgpp Subject: Re: Locking entire program in memory? Date: Sat, 8 Mar 1997 21:33:45 +0000 Organization: None Distribution: world Message-ID: <0Tb+TRA5sdIzEwj2@talula.demon.co.uk> References: <332163FC DOT 592C AT mail DOT connect DOT usq DOT edu DOT au> NNTP-Posting-Host: talula.demon.co.uk MIME-Version: 1.0 Lines: 27 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Matthew Kennedy writes: >I've got a sophisticated 'real-time' program (with lots of ISR hooking >etc) and I'd like to lock the ENTIRE program (code,data - everthing) out >of virtual memory disk swaps. How can I perform this? Currently I only >lock out the code/data that is critical - but I can't lock out the other >libraries like standard I/O. Somewhere in your program, add a global variable: #include int _crt0_startup_flags = _CRT0_FLAG_NONMOVE_SBRK | _CRT0_FLAG_LOCK_MEMORY; Look in crt0.h for details about this: there are a lot of other handy flags that you can set in this way, to control the behaviour of the startup code and library routines. Whether locking the entire program is a good move, though, I tend to doubt. It isn't a very polite way to behave, if it is going to be run under a multitasking OS :-) /* * Shawn Hargreaves - shawn AT talula DOT demon DOT co DOT uk - http://www.talula.demon.co.uk/ * Beauty is a French phonetic corruption of a short cloth neck ornament. */