This causes strange errors in subversion. If you for example compile subversion with ipv6 support but in runtime never load the ipv6 kernel module you get errors like: svn: Can't read directory '.': Address family not supported by protocol The problem here is that apr_read_dir() assumes that the return value is set upon reaching end of directory stream. This is not the case and apr does a hack to work around this in glibc but this workaround does not work for uclibc. POSIX claims [1]: Upon successful return, the pointer returned at *result shall have the same value as the argument entry. Upon reaching the end of the directory stream, this pointer shall have the value NULL. The apr assumes errno==0 or errno==EINVAL which is wrong.
Created attachment 149672 [details, diff] apr-1.2.11-readdir_r.patch this patch does the right thing and saves the day.
This code is slightly different in APR trunk. Could you check if it was fixed there? The ebuild for APR trunk is available in Eaedificāta Repository: http://www.ffta.host.sk/Eaedificata/index.html
(In reply to comment #2) > This code is slightly different in APR trunk. > Could you check if it was fixed there? > > The ebuild for APR trunk is available in Eaedificāta Repository: > http://www.ffta.host.sk/Eaedificata/index.html > yeah, the way trunk handle it should also work. https://svn.apache.org/repos/asf/apr/apr/trunk/file_io/unix/dir.c.
Created attachment 149683 [details, diff] apr-1.2.11-readdir_r.patch updated patch. does the same as upstream trunk.
argh!!! no the code in trunk does not work for uclibc. # svn up svn: Can't read directory '.': Address family not supported by protocol
Comment on attachment 149672 [details, diff] apr-1.2.11-readdir_r.patch this is probably the safest way to deal with this. probably also solves the solaris stuff
Comment on attachment 149683 [details, diff] apr-1.2.11-readdir_r.patch this didnt work. first one does.
i would say that the posix specification is a bit unclear on the return status. What is safe is: *result shall have the same value as the argument 'entry' on success. Upon end of directory stream, the '*result' is NULL. That is how first patch works.
If the code from trunk doesn't work, then please report an upstream bug at: https://issues.apache.org/bugzilla/
The posix is a bit unclear but it seems like uclibc tries to behave like gnu libc and they have fixed in in uclibc trunk. So this actually ends up to be a bug in the uclibc implementation.
Created attachment 149790 [details, diff] 40_all_uClibc-0.9.28.3-readdir_r.patch patch for uclibc
please reasign to embedded
OK, uClibc-0.9.28.3-r4 contains pulls in Natanael's patch from uClibc trunk, which should be fixing this issue.