aboutsummaryrefslogtreecommitdiff
path: root/libgo/runtime/go-gomaxprocs.c
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/runtime/go-gomaxprocs.c')
-rw-r--r--libgo/runtime/go-gomaxprocs.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/libgo/runtime/go-gomaxprocs.c b/libgo/runtime/go-gomaxprocs.c
index 04dc448..65146c5 100644
--- a/libgo/runtime/go-gomaxprocs.c
+++ b/libgo/runtime/go-gomaxprocs.c
@@ -7,9 +7,17 @@
/* This is the runtime.GOMAXPROCS function. This currently does
nothing, since each goroutine runs in a separate thread anyhow. */
-void GOMAXPROCS (int) asm ("libgo_runtime.runtime.GOMAXPROCS");
+extern int GOMAXPROCS (int) asm ("libgo_runtime.runtime.GOMAXPROCS");
-void
-GOMAXPROCS (int n __attribute__ ((unused)))
+static int set = 1;
+
+int
+GOMAXPROCS (int n)
{
+ int ret;
+
+ ret = set;
+ if (n > 0)
+ set = n;
+ return ret;
}