I have tried to find an answer to my problem but it seems that this issue is kind of weird.
Here is what happened: I am running PHP 4.0.2 on Solaris 2.5.1-2.8. At random times PHP just crashes in a readdir_r related function. These crashes happen during the cleanup of session files (probably when Apache recycles a process). So I was looking at the PHP 4.0.3 change log and saw an entry that was related to the symptoms I saw.
I installed PHP 4.0.3. That is, I tried to install. Suddenly I get a compilation error in reentrancy.c (missing argument, got 2, expected 3). The problem is in the configure script. A test program core dumps during check of readdir_r. Hence, PHP wants to use the old-style readdir_r with 2 arguments instead of three. However, somewhere it also defines -D_POSIX_THREAD_SEMANTICS. This includes the 3 argument readdir_r.
I was looking at the source code of PHP 4.0.2, 4.0.3, 4.0.3pl1 and CVS. It seems that after a few iterations this problem has been solved.
Does anyone know the history on these changes and the reasons why they were implemented differently? Also, when is the next official release scheduled, that hopefully fixes this problem? What amazes me the most is that nobody besides one person who filed bug report 7534 has this problem. Maybe nobody upgraded to PHP 4.0.3 on Solaris yet (?).
Thank you,
Roland