path: root/include/limits.h
diff options
authorBrooks Davis <brooks@FreeBSD.org>2018-10-04 21:55:58 +0000
committerBrooks Davis <brooks@FreeBSD.org>2018-10-04 21:55:58 +0000
commit8bff61a6ba2b043cc42e29a0a957df23b74600b5 (patch)
tree8d1bdbf1b8beb97a7eacbe8c1c0b8260ae26b885 /include/limits.h
parent9657b80ce7682c0737d218e48389b54db1fe16a8 (diff)
Reduce NL_ARGMAX to 4096 to match Linux.
NL_ARGMAX is the maximum number of positional arguments supported by printf(3). Prior to r308145 it was declared as 99 and not enforced. r308145 added enforcement and increased the value to 64k. Unfortunately, development versions of PostgreSQL used the system definition to allocate and zero an NL_ARGMAX * 4 sized array on the stack of its snprintf implementation with measurable performance impacts. This has been fixed in new PostgreSQL versions, but it is possible that other programs suffer from this problem. A value of 4096 puts us on par with Linux and is certainly large enough for any reasonable program. Reviewed by: mjg Reported by: mjg Approved by: re (gjb) Differential revision: https://reviews.freebsd.org/D17387 Differential revision: https://reviews.freebsd.org/D8286
Notes: svn path=/head/; revision=339184
Diffstat (limited to 'include/limits.h')
1 files changed, 1 insertions, 1 deletions
diff --git a/include/limits.h b/include/limits.h
index e26a741c83a1..fc1470c058cb 100644
--- a/include/limits.h
+++ b/include/limits.h
@@ -122,7 +122,7 @@
#if __XSI_VISIBLE || __POSIX_VISIBLE >= 200809
-#define NL_ARGMAX 65536 /* max # of position args for printf */
+#define NL_ARGMAX 4096 /* max # of position args for printf */
#define NL_MSGMAX 32767
#define NL_SETMAX 255
#define NL_TEXTMAX 2048