Mercurial > hg > CbC > CbC_gcc
annotate libgo/runtime/getncpu-solaris.c @ 136:4627f235cf2a
fix c-next example
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 08 Nov 2018 14:11:56 +0900 |
parents | 04ced10e8804 |
children |
rev | line source |
---|---|
111 | 1 // Copyright 2012 The Go Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style | |
3 // license that can be found in the LICENSE file. | |
4 | |
5 #include <unistd.h> | |
6 | |
7 #include "runtime.h" | |
8 #include "defs.h" | |
9 | |
10 int32 | |
11 getproccount(void) | |
12 { | |
13 int32 n; | |
14 n = (int32)sysconf(_SC_NPROCESSORS_ONLN); | |
15 return n > 1 ? n : 1; | |
16 } |