From: "Charles Sandmann" Newsgroups: comp.os.msdos.djgpp Subject: Re: [Q] Is it possible to write-protect the text section ? Date: Thu, 10 Jul 1997 22:44:01 Organization: Aspen Technology, Inc. Lines: 10 Message-ID: <33c565b1.sandmann@clio.rice.edu> References: <5q2oak$mfh$2 AT arcturus DOT ciril DOT fr> Reply-To: sandmann AT clio DOT rice DOT edu NNTP-Posting-Host: spica.dmccorp.com To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Yes, but... sys/mman.h mprotect() will provide a way to make pages readonly. There is a (very bad) place in exceptn.S which writes to the text section to store things which need to be locked (I regret doing this, so the text can't be easily automatically made readonly). This page or two needs to be kept read/write (unless someone fixes it...) And this only works with DPMI 1.0 features, so you would need CWSDPMI or 386MAX to make it work.