getncpu-irix.c 320 B

1234567891011121314151617
  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. #include <unistd.h>
  5. #include "runtime.h"
  6. #include "defs.h"
  7. int32
  8. getproccount(void)
  9. {
  10. int32 n;
  11. n = (int32)sysconf(_SC_NPROC_ONLN);
  12. return n > 1 ? n : 1;
  13. }