On 16 Feb 2013, at 18:11, Michael Baeuerle wrote:

> Here it is:
> http://micha.freeshell.org/tmp/2013-02-16_scandir.tar.gz
> 
> The archive contains the new implementation, the old implementation and
> some test programs to compare the new, the old and the native
> implementation of the system. The test programs show the content of the
> current working directory. If a name is specified as parameter, a filter
> is applied to mask all other directory entries.
> 
> The new implementation locks a mutex if HAVE_PTHREAD is #defined. In
> this mode it should be thread safe even if readdir() is not reentrant
> (that is allowed by POSIX).
> 
> At the moment I can't access the Sun machine from here, but I have
> tested on AIX 5.1 and HP-UX 11.11 and it works on both. I will test on
> the Sun the next few days. In the meanwhile it would be nice if somebody
> else can run the test programs on other systems.

Tried it on a few linux distros, and on OSX (10.6.8)

Appears to be good.

Observations are...

- Had to add #include <string.h> into scandir_old.c to get things to compile 
nicely (on linux and OSX)

- Added -Wall to the Makefile, just in case, but it didn't flag much of note, 
other than...

- The "native" test on OSX fails outright, the OSX scandir is "odd"... And 
forcibly setting

   #define _POSIX_C_SOURCE  200809L

makes it worse... Commenting out that line allows the code to run "correctly" 
but -Wall warns that the prototype is wrong (unsurprisingly!)

However, your code appears to be good!

Cheers,
-- 
Ian


_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to