delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2000/12/25/04:59:47

From: "Tim Van Holder" <tim DOT van DOT holder AT pandora DOT be>
To: <djgpp-workers AT delorie DOT com>
Subject: RE: An implementation of /dev/zero for DJGPP
Date: Mon, 25 Dec 2000 11:03:17 +0100
Message-ID: <NEBBIOJNGMKPNOBKHCGHOEAMCAAA.tim.van.holder@pandora.be>
MIME-Version: 1.0
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
In-Reply-To: <Pine.SUN.3.91.1001225105413.18547C-100000@is>
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
Importance: Normal
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

> > 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,
> <sys/devzero.h>, 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.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019