$NetBSD: patch-ah,v 1.3 2023/08/29 15:05:40 vins Exp $ Dragonfly-specific dirent handling. --- lib/listdir.c.orig 2023-08-29 13:05:15.278866678 +0000 +++ lib/listdir.c @@ -972,7 +972,11 @@ tc_scandir( const char * dirname, #if defined __VMS && __VMS_VER < 70000000 || defined opennt || defined __CYGWIN__ total = dname_is_1 ? strlen( dentry->d_name ) : sizeof *dentry; #else +# ifdef __DragonFly__ + total = dname_is_1 ? _DIRENT_RECLEN(dentry->d_namlen) : sizeof *dentry; +# else total = dname_is_1 ? dentry->d_reclen : sizeof *dentry; +# endif #endif head[ n ] = fl_malloc( total ); memcpy( head[ n ], dentry, total );