summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/util.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/source3/lib/util.c b/source3/lib/util.c
index a9aebd0822..fd48cbfa83 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -2969,3 +2969,21 @@ BOOL procid_is_local(const struct process_id *pid)
{
return True;
}
+
+int this_is_smp(void)
+{
+#if defined(HAVE_SYSCONF)
+
+#if defined(SYSCONF_SC_NPROC_ONLN)
+ return (sysconf(_SC_NPROC_ONLN) > 1) ? 1 : 0;
+#elif defined(SYSCONF_SC_NPROCESSORS_ONLN)
+ return (sysconf(_SC_NPROCESSORS_ONLN) > 1) ? 1 : 0;
+#else
+ return 0;
+#endif
+
+#else
+ return 0;
+#endif
+}
+