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


On Wed, Dec 11, 2002 at 03:56:17PM -0500, Pierre A. Humblet wrote:
>Christopher Faylor wrote:
>
>> Shouldn't the global symbols be marked as "NO_COPY"?
>
>I am not sure why things are as they are.
>These symbols are initialized in do_global_ctors and never change.
>Are the constructors running again after a fork? If so, NO_COPY is fine.
>It would seem more efficient to copy than to rerun the constructors,
>but I probably overlook some factors.

Constructors are always run.  If you use a global constructor without a
NO_COPY then you just end up writing over the contents when the fork
completes.  So, if the constructor is setting things up correctly the
global should be NO_COPY.  Actually, if you can get away without using a
constructor that would be best.  Constructors are a noticeable part of
cygwin's startup cost.

cgf


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