Protect handle issue-ettes

Conrad Scott
Sun Jul 14 11:26:00 GMT 2002

"Christopher Faylor" <> wrote:
> Huh?  The code in dll_crt0_1 is supposed to be called
> on a fork or an exec.  That's why I renamed it to
> debug_fixup_after_fork_exec.
> As far as I can tell it *is* called on a fork.
> strace confirms that.

Sorry Chris, I've obviously misunderstood something then.  I tried
calling setclexec() for one of the handles that was causing
trouble (the title_mutex) but it didn't change anything, while
removing the ProtectHandle call for it removed a whole lot of
warnings (as far as I can remember from this morning).

One thing that is confusing me is that if you call fcntl() to set
the close-on-exec flag for a file descriptor, this ends up calling
setclexec().  But if the clexec flag is honoured on fork (as well
as exec) how can this be right?

I'll go have another look at the code sometime soon and write some
test programs, since the volume of warnings in the cygserver
branch is a little distracting.

Thanks for the response,

// Conrad

More information about the Cygwin-patches mailing list