non-portable readdir_r() use can cause segmentation fault
The gromacs 4.5.4 pdb2gmx causes a segmentation fault on Solaris due
to a non-portable use of readdir_r() in futil.c. On Solaris, memory must
be allocated for the dirent structure, since the d_name member is defined
as "char d_name1" (on Linux it is "char d_name256").
The attached patch fixes the issue using by allocating memory for the
dirent structure as suggested in the Linux readdir(3) man page: