summaryrefslogtreecommitdiff
path: root/libgo/runtime/getncpu-irix.c
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/runtime/getncpu-irix.c')
-rw-r--r--libgo/runtime/getncpu-irix.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/libgo/runtime/getncpu-irix.c b/libgo/runtime/getncpu-irix.c
new file mode 100644
index 00000000000..a65ca63d2ae
--- /dev/null
+++ b/libgo/runtime/getncpu-irix.c
@@ -0,0 +1,16 @@
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+#include <unistd.h>
+
+#include "runtime.h"
+#include "defs.h"
+
+int32
+getproccount(void)
+{
+ int32 n;
+ n = (int32)sysconf(_SC_NPROC_ONLN);
+ return n > 1 ? n : 1;
+}