From: Eric Wong Date: Sat, 19 Aug 2023 09:56:53 +0000 (+0000) Subject: ipc: support _SC_NPROCESSORS_ONLN on OpenBSD X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d7d41f6ea7cfeb14fef5b7834b2f486eddb8195e;p=thirdparty%2Fpublic-inbox.git ipc: support _SC_NPROCESSORS_ONLN on OpenBSD Tested on both amd64 and i386, and these constants tend to be architecture-independent. --- diff --git a/lib/PublicInbox/IPC.pm b/lib/PublicInbox/IPC.pm index c154724e7..847657484 100644 --- a/lib/PublicInbox/IPC.pm +++ b/lib/PublicInbox/IPC.pm @@ -455,6 +455,7 @@ sub detect_nproc () { # _SC_NPROCESSORS_ONLN = 84 on both Linux glibc and musl return POSIX::sysconf(84) if $^O eq 'linux'; return POSIX::sysconf(58) if $^O eq 'freebsd'; + return POSIX::sysconf(503) if $^O eq 'openbsd'; # TODO: more OSes # getconf(1) is POSIX, but *NPROCESSORS* vars are not