This is the mail archive of the
mailing list for the Cygwin project.
Re: Problem with Cygwin's fdopen and Windows handles
Christopher Faylor <cgf-use-the-mailinglist-please <at> cygwin.com> writes:
> Please calm down.
I am calm :-) I just happen to like exclamation signs.
> I guess I shouldn't have said the "doesn't really work" and stuck with
> "of limited utility". fds attached with cygwin_attach_handle_to_fd are
> not fully functional.
You still have not answered my question. C fds are working. They
allow read() write() and close(). The question is actually why fread()
does not work. From your email I still am not convinced that
the problem is with cygwin_attach_handle_to_fd(). Do ANSI streams
need something that C file ids do not provide?
> >I have seen messages in a sibling mailing list reporting that fork()
> >fails when a program injects libraries using various mechanisms
> "sibling mailing list"? That is this mailing list.
Sorry, it is very difficult for me to identify in gmane the actual name
of the mailing list.
> If you have an application which uses a lot of dlls then best practice
> for Windows DLLs is to build them with unique load addresses. Barring
> that you could rebase them with cygwin's rebase or rebaseall utilties.
> Setting unique base addresses will actually cause your application to
> load slightly faster whether you use Cygwin or not.
It seems I did not express myself properly. Code is compiled on the fly.
DLLs do not survive beyond program execution. This is a dynamic language
(Common Lisp btw) and functions are compiled and run and consumed
quickly. Calling rebase for each invocation is overkill (it will scan the
whole system!) and I would not even know how to start assigning
fixed addresses to libraries myself.
Let me insist that we could live without fork if only
fread() on Windows handles worked -- all ECL needs is a means
to execute programs with redirected input/output & error channels
(a bit beyond what popen() does).
If the answer is we should abandon Cygwin or deprecate it for this
project, it would be nice to know.
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple