--- a/mercurial/osutil.c Mon Oct 08 22:45:48 2007 -0700
+++ b/mercurial/osutil.c Tue Oct 09 08:39:37 2007 -0700
@@ -17,6 +17,10 @@
#include <sys/types.h>
#include <unistd.h>
+#if defined(__sun)
+#define dirfd(dir) ((dir)->dd_fd)
+#endif
+
struct listdir_stat {
PyObject_HEAD
struct stat st;