Created attachment 430988 [details] patch for missing d_type/DT_DIR On Solaris, dirent doesn't have d_type/DT_DIR. One has to stat instead. files/portage-utils-0.61-solaris.patch uses a stat if DT_DIR isn't defined to use S_ISDIR to achieve the same thing.
i rewrote things a bit ... it should still cover your usage: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=0cd1766c6aac6965666797dd875b1fdc0ea91b47