--- process.c.orig	2007-10-23 18:50:29.000000000 +0200
+++ process.c	2007-10-23 19:08:01.000000000 +0200
@@ -96,9 +96,16 @@
 #undef HAVE_SETRGID
 #endif
 
-#if defined(__MacOS_X__) || defined(__bsdi__)
-#define BROKEN_SETREUID 1
-#define BROKEN_SETREGID 1
+#if defined(__APPLE__)
+# include <AvailabilityMacros.h>
+/* setreuid/setregid were broken in Mac OS X <= 10.4, but were fixed since. */
+# if MAC_OS_X_VERSION_MAX_ALLOWED <= 1040
+#  define BROKEN_SETREUID 1
+#  define BROKEN_SETREGID 1
+# endif
+#elif defined(__bsdi__)
+# define BROKEN_SETREUID 1
+# define BROKEN_SETREGID 1
 #endif
 
 #if defined(HAVE_44BSD_SETUID) || defined(__MacOS_X__)
