On Sun, Mar 31, 2019 at 3:58 AM William A Rowe Jr <wr...@rowe-clan.net> wrote:
>
> Let me just throw this out there and get your reaction, Yann, now that
> I'm back in town... The patch I was initially using to accomplish the
> equivalent was as simple as;
[]
> Seems much less wordy for a feature we agree should just be dropped
> altogether fairly soon. Thoughts?

I don't know actually, I think it's not really "fair" to say that
readdir() is thread-safe, you can't really call it from different
threads with the same DIR arg, while you might with readdir_r()
(besides all its caveats). I'm talking about the system functions
here, not apr_dir_read() which is not thread-safe (on the same
apr_dir_t) with either underlying function, as we discussed elsewhere.
But who would do that anyway?! I think we should do[x]cument that just in case.

As for your patch vs mine, it depends on whether it exists systems
(that we still support) on which readdir() is really not thread-safe
even with different passed-in DIRs (e.g. the returned struct dirent is
static somewhere in the implementation, as opposed to some room
reserved in the struct DIR itself like in "modern" implementations),
and these systems provide readdir_r() for the "thread-safe" way.
I suppose such system wouldn't emit a warning for readdir_r(), my
patch addresses them while yours does not.
So the question is, does such system exists and do we want to still support it?

Reply via email to