From: "Tim Van Holder" To: Subject: RE: An implementation of /dev/zero for DJGPP Date: Mon, 25 Dec 2000 11:03:17 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) In-Reply-To: X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Importance: Normal Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id EAA17916 Reply-To: djgpp-workers AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > > One way is via command line: > > > > gcc -Wl,-u,__use_dev_zero ... > > > > Or, in main, > > > > __use_dev_zero(); > > Yes, something like that. > > It might be even better if we could have a special header, > , say, which, if included in a program, would pull in > the /dev/zero support automatically, by some magic. > > > I would think that making it the default would be wrong in general. > > I agree. Or you could have some bitmask (_djgpp_fsext_devices?) that is checked in the startup code and will call the necessary init functions: extern int _djgpp_fsext_devices; int _djgpp_fsext_devices = __FSEXT_DEV_ZERO | __FSEXT_DEV_RANDOM; This would easily fit into DJGPP, as this method is already used to select functionality in system() and stat(). The only drawback is that the startup code would then draw in all the relevant init functions, but I think they'd usually be very small.