From f90c65410264d8346b711e36bca7ee1f0dde5ca9 Mon Sep 17 00:00:00 2001 From: semarie Date: Tue, 11 Nov 2025 18:54:05 +0000 Subject: [PATCH] bump PTHREAD_KEYS_MAX to 512 the rust libstd emutls version is using one pthread_key per thread-variable. it means the maximum number of thread-variable at a time is PTHREAD_KEYS_MAX. with recent rustc 1.91.0, we start hiting the limit while compiling some programs (like sysutils/rustic). ok robert@ "Let's go 512 and hope someone eventually does proper TLS" deraadt@ --- include/pthread.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/pthread.h b/include/pthread.h index cfb1356a1d4..d972dd8b093 100644 --- a/include/pthread.h +++ b/include/pthread.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pthread.h,v 1.4 2018/03/05 01:15:26 deraadt Exp $ */ +/* $OpenBSD: pthread.h,v 1.5 2025/11/11 18:54:05 semarie Exp $ */ /* * Copyright (c) 1993, 1994 by Chris Provenzano, proven@mit.edu @@ -50,7 +50,7 @@ * Run-time invariant values: */ #define PTHREAD_DESTRUCTOR_ITERATIONS 4 -#define PTHREAD_KEYS_MAX 256 +#define PTHREAD_KEYS_MAX 512 #define PTHREAD_STACK_MIN (1U << _MAX_PAGE_SHIFT) #define PTHREAD_THREADS_MAX ULONG_MAX