apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Justin Erenkrantz <jerenkra...@ebuilt.com>
Subject Re: file_setaside()
Date Tue, 26 Jun 2001 15:41:57 GMT
On Tue, Jun 26, 2001 at 11:29:32AM -0400, Cliff Woolley wrote:
> On Tue, 26 Jun 2001, Justin Erenkrantz wrote:
> > Why?  Don't we need to create a duplicate file handle?  What am I
> > missing?  -- justin
> Not for file_setaside() we don't.  All file_setaside() cares about is that
> the apr_file_t and its associated locks and stuff get put into the
> appropriate pool.  The apr_os_file_t file handle that is referred to by
> the apr_file_t knows nothing about pools (it's just an int or HANDLE or
> HFILE or whatever).  So we can keep the same apr_os_file_t and just wrap a
> new apr_file_t around it.  No call to the OS's dup() is needed.  Make
> sense?

What about the case where the original apr_file_t is cleaned up 
(i.e. closed) before we are done with the "new" apr_file_t?  (This is
the whole purpose of setaside, right?)  Won't that cause a problem 
since the original descriptor has now been closed in kernel space?  
We'll have ourselves a nice invalid file descriptor.  Or, am I
wrong?  -- justin

View raw message