summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane2007-09-26 00:32:46 +0000
committerTom Lane2007-09-26 00:32:46 +0000
commit924e87af7de6eeb9fe19705977ee1f711ced3177 (patch)
treec8b5e585e42fccfcb1298b1b44b2baa9ae1040ba
parentfc0ee062aafa5ec800dc0461387c3b01ca3d85ec (diff)
Use SYSV semaphores rather than POSIX on Darwin >= 6.0 (i.e., OS X 10.2
and up), per Chris Marcellino. This avoids consuming O(N^2) file descriptors to support N backends. Tests suggest it's about a wash for small installations, but large ones would have a problem.
-rw-r--r--src/template/darwin14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/template/darwin b/src/template/darwin
index 9ddbbb7526..f9090828b1 100644
--- a/src/template/darwin
+++ b/src/template/darwin
@@ -4,5 +4,15 @@
# (Note: on OS X before 10.2, you might need -traditional-cpp instead)
CC="$CC -no-cpp-precomp"
-# Select appropriate semaphore support
-USE_NAMED_POSIX_SEMAPHORES=1
+# Select appropriate semaphore support. Darwin 6.0 (Mac OS X 10.2) and up
+# support System V semaphores; before that we have to use POSIX semaphores,
+# which are less good for our purposes because they eat a file descriptor
+# per backend per max_connection slot.
+case $host_os in
+ darwin[015].*)
+ USE_NAMED_POSIX_SEMAPHORES=1
+ ;;
+ *)
+ USE_SYSV_SEMAPHORES=1
+ ;;
+esac