]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
ipc: support _SC_NPROCESSORS_ONLN on OpenBSD
authorEric Wong <e@80x24.org>
Sat, 19 Aug 2023 09:56:53 +0000 (09:56 +0000)
committerEric Wong <e@80x24.org>
Sat, 19 Aug 2023 20:58:45 +0000 (20:58 +0000)
Tested on both amd64 and i386, and these constants tend to be
architecture-independent.

lib/PublicInbox/IPC.pm

index c154724e74159ef8c38bc6bae3356c68b419869b..84765748402092a60df908365a05eb60b02ab544 100644 (file)
@@ -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