aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2019-02-01 22:55:55 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2019-02-01 22:55:55 +0000
commitcf5773c116f18f0702ca072f9496d15795e3e942 (patch)
tree7e86ba170ed153d286c7cb3739cc3f7120f109f7
parent30253e235699f233b54f0ee147235bdec5759ac8 (diff)
downloadgcc-cf5773c116f18f0702ca072f9496d15795e3e942.zip
gcc-cf5773c116f18f0702ca072f9496d15795e3e942.tar.gz
gcc-cf5773c116f18f0702ca072f9496d15795e3e942.tar.bz2
runtime: add getproccount for hurd
Patch by Svante Signell. Reviewed-on: https://go-review.googlesource.com/c/160825 From-SVN: r268463
-rw-r--r--gcc/go/gofrontend/MERGE2
-rw-r--r--libgo/runtime/getncpu-hurd.c16
2 files changed, 17 insertions, 1 deletions
diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE
index 1036fc9..c32a85b 100644
--- a/gcc/go/gofrontend/MERGE
+++ b/gcc/go/gofrontend/MERGE
@@ -1,4 +1,4 @@
-51fb93fd71b8a0a690455dfdd3d12b2aa0171f5c
+582392b80c07bd7e830e177b775dc4ef802b5fd6
The first line of this file holds the git revision number of the last
merge done from the gofrontend repository.
diff --git a/libgo/runtime/getncpu-hurd.c b/libgo/runtime/getncpu-hurd.c
new file mode 100644
index 0000000..5d5d702
--- /dev/null
+++ b/libgo/runtime/getncpu-hurd.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_NPROCESSORS_ONLN);
+ return n > 1 ? n : 1;
+}