This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Incomplete environ when running MinGW apps?
Dave Korn wrote:
Out of curiosity, what's the problem with just using popen("...") always?
I get the feeling you're working up to telling me something I don't want
to hear, but I shall carry on regardless... :)
[_]popen is fine if you want to execute a process and either just get
its stdout, or just supply its stdin, but not both (and you only want a
console app; it's buggy, apparently). If you want all 3 of stin, stdout,
and stderr redirected, as I do, you must (I think) use CreateProcess and
do the donkey work yourself. I haven't investigated what _popen does to
slashes and quotes, but it's presumably the same as 'system'.
You only need to use pipes at all because Windoze processes can't
reliably inherit sockets. But, as it turns out, the process and pipe
creation is not the difficult part of the problem anyway. The real
bu**er is connecting the pipes to the socket that talks to the remote
peer. Since select is broken, you have to do this with multiple threads
and events, and async waits.
-Paul
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/