apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Trawick <traw...@gmail.com>
Subject Re: svn commit: r291341 - in /apr/apr/branches/0.9.x: CHANGES file_io/unix/dir.c test/testdir.c
Date Tue, 27 Sep 2005 17:10:28 GMT
On 9/27/05, Joe Orton <jorton@redhat.com> wrote:
> On Tue, Sep 27, 2005 at 10:48:56AM -0400, Jeff Trawick wrote:
> > On 9/27/05, Joe Orton <jorton@redhat.com> wrote:
> > > On Tue, Sep 27, 2005 at 01:49:29PM +0100, Joe Orton wrote:
> > > > On Tue, Sep 27, 2005 at 07:55:14AM -0400, Jeff Trawick wrote:
> > > > > This chdir && rmdir operation fails with EBUSY on AIX and
HP-UX.  (I
> > > > > see it work on Linux; haven't tested other boxes.)  Is there another
> > > > > way to accomplish the test?
> > >
> > > Can you test whether the trunk code handles this OK?  If so I'll
> > > backport it everywhere.
> >
> > ouch, can't get trunk to build on AIX at the moment*; I'll try to test
> > the trunk testdir.c change with 0.9.x on AIX later toda
>
> Ahhhrrrm, just more stuff I borked :) That is a non-threaded build?  I
> can see how that is broken.

it is a threaded build; but READDIR_IS_THREAD_SAFE is defined

whether or not we actually use readdir64() needs to be separated from
whether or not the function is defined

some of the usage of readdir64 (e.g., in struct apr_dir_t) is based on
simply whether or not the function exists

other usage (such as actually calling it) is based on this combination:

#if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) \
                    && !defined(READDIR_IS_THREAD_SAFE)
#ifdef HAVE_READDIR64_R

quick hack:

#if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) \
                    && !defined(READDIR_IS_THREAD_SAFE) \
                    && defined(HAVE_READDIR64_R)
#define USE_READDIR64_R 1
#else
#define USE_READDIR64_R 0
#endif

struct apr_dir_t {
    apr_pool_t *pool;
    char *dirname;
    DIR *dirstruct;
#if USE_READDIR64_r
    struct dirent64 *entry;
#else
    struct dirent *entry;
#endif
};

then check USE_READDIR64_R in dir.c

Mime
View raw message