httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Stoddard" <stodd...@raleigh.ibm.com>
Subject Re: dup2() on Windows
Date Tue, 15 Feb 2000 22:18:25 GMT
> I hate the whole idea of these functions.  :-)
I knew you would :-)

> 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?
If it's possible, I don't know how to do it. I don't think it is possible.
The only thing close to this is the SetStdHandle() call which allows you to
change the handle to stdio. For example, I can call
SetStdHandle(STD_ERROR_HANDLE, hErrorLog) to cause the error log to
intercept data directed to stderr.

>
> Regardless, is the dup2 semantic important to Windows?
Yes. In ap_open_logs, we redirect stderr out to the error log. That is the
case that is important to Apache on Windows that is handled by
ap_dup2stderr().
> Can we accomplish
> the same thing with the other semantic of ap_dupfile?
I don't think so.

> 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.
Better not hold your breath. I figured there'd be opposition, which is why I
mailed the note.  BTW, you will have the same problem on other platforms
that do not support dup2 (if there are any). For now, I'll #ifdef WIN32 it
unless another dup2 deficient platform pops up, at which time I'll consider
creating a feature macro.

Bill



Mime
View raw message