--- a/mercurial/osutil.c Tue Oct 09 17:25:24 2007 -0500 +++ b/mercurial/osutil.c Tue Oct 09 17:44:44 2007 -0500 @@ -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;