3.5 Reentrancy

LibC is designed to support reentrant NLM programming and the use of the REENTRANT linker command. A reentrant NLM can be loaded multiple times, but the server keeps only a single image of the NLM code in memory, rather than a code instance for each load.

Nonreentrant NLM applications call the _LibCPrelude startup function each time they are loaded. Reentrant NLM applications, on the other hand, call _LibCPrelude only on their initial load and do not call _LibCPrelude on reentrant loads. All of this is handled transparently for the NLM applications that link the libcpre object file and declare the following linker commands: