unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
* [PATCH] ipc: support _SC_NPROCESSORS_ONLN on OpenBSD
@ 2023-08-19  9:56 Eric Wong
  0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2023-08-19  9:56 UTC (permalink / raw)
  To: meta

Tested on both amd64 and i386, and these constants tend to be
architecture-independent.
---
 lib/PublicInbox/IPC.pm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/PublicInbox/IPC.pm b/lib/PublicInbox/IPC.pm
index c154724e..84765748 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

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2023-08-19  9:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-19  9:56 [PATCH] ipc: support _SC_NPROCESSORS_ONLN on OpenBSD Eric Wong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).