This is the mail archive of the cygwin-patches@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Small security patches


Corinna Vinschen wrote:
> 
> On Thu, Dec 12, 2002 at 11:34:02AM -0500, Pierre A. Humblet wrote:
> > Christopher Faylor wrote:
> > >
> > > Actually, if you can get away without using a
> > > constructor that would be best.  Constructors are a noticeable part of
> > > cygwin's startup cost.

> What about this idea:
> 
> Add a static method init() called from .  Init() checks if it has been
> called already before and returns immendiately if so.  Otherwise it
> initializes the external objects.
> 
> Shouldn't that be sufficient?

That looks great. Can that be generalized? There must be other
modules inside Cygwin that also need to initialize constant structures.
Could all of these initializers be called from some central place, if needed,
rather than having everybody maintain a separate "isinitialized" variable and
add lines in the middle of dll_crt0_1 ()?
In fact we may not even need a central "isinitialized" variable if the
centralized routine is skipped only in case of forks.

Pierre


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]