Mail Archives: djgpp-workers/2000/12/25/04:59:47
> > 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 -