httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@apache.org
Subject Re: dup2() on Windows
Date Tue, 15 Feb 2000 20:00:24 GMT

> Windows does not support a native (non-POSIX) equivalent to dup2, which
> means that ap_dupfile() cannot be correctly implemented in APR on Windows.
> (ap_dupfile() does a dup or dup2 under the covers, depending on the
> arguments passed in. We cannot handle the dup2 case in Windows). Thus,
> ap_open_logs is broken for Windows.
> 
> I have two solutions available. I can use #ifdef WIN32 blocks in
> ap_open_file(), or extend APR with the following new functions:
> 
> ap_dup2stderr()
> ap_dup2stdin()
> ap_dup2stdout()
> 
 
I hate the whole idea of these functions.  :-)  The fact that they are
necessary is absolutely horrid.  I question if they really are.  Are you 
telling me, if I have two open handles on Windows, I can't make them point
to the same file?  That is ludicrous, IMHO.

Regardless, is the dup2 semantic important to Windows?  Can we accomplish
the same thing with the other semantic of ap_dupfile?  I'm just asking,
not having a Windows box right now, I can't really investigate much.

However, if we add ap_dup2std(err|in|out), those functions will always be
in APR, so I am -1 for adding those to APR.  I would rather see #ifdefs in
http_log until M$ wakes up and adds some functions to their API.

Ryan

Come to the first official Apache Software Foundation
Conference!!!   <http://ApacheCon.Com/>

_______________________________________________________________________________
Ryan Bloom                        	rbb@ntrnet.net
2121 Stonehenge Dr. Apt #3
Raleigh, NC 27615		Ryan Bloom -- thinker, adventurer, artist,
				     writer, but mostly, friend.
-------------------------------------------------------------------------------


Mime
View raw message