summaryrefslogtreecommitdiffstats
path: root/rtemstoolkit/netbsd.py
diff options
context:
space:
mode:
Diffstat (limited to 'rtemstoolkit/netbsd.py')
-rw-r--r--rtemstoolkit/netbsd.py19
1 files changed, 12 insertions, 7 deletions
diff --git a/rtemstoolkit/netbsd.py b/rtemstoolkit/netbsd.py
index 5883682..112fba1 100644
--- a/rtemstoolkit/netbsd.py
+++ b/rtemstoolkit/netbsd.py
@@ -1,6 +1,6 @@
#
# RTEMS Tools Project (http://www.rtems.org/)
-# Copyright 2010-2016 Chris Johns (chrisj@rtems.org)
+# Copyright 2010-2017 Chris Johns (chrisj@rtems.org)
# All rights reserved.
#
# This file is part of the RTEMS Tools package in 'rtems-tools'.
@@ -24,7 +24,6 @@
# RTEMS project's spec files.
#
-import pprint
import os
try:
@@ -34,15 +33,19 @@ except (ValueError, SystemError):
import check
import execute
-def load():
- uname = os.uname()
+def cpus():
sysctl = '/sbin/sysctl '
e = execute.capture_execution()
exit_code, proc, output = e.shell(sysctl + 'hw.ncpu')
if exit_code == 0:
- ncpus = output.split(' ')[1].strip()
+ ncpus = int(output.split(' ')[1].strip())
else:
- ncpus = '1'
+ ncpus = 1
+ return ncpus
+
+def overrides():
+ uname = os.uname()
+ ncpus = '%d' % (cpus())
if uname[4] == 'amd64':
cpu = 'x86_64'
else:
@@ -93,4 +96,6 @@ def load():
return defines
if __name__ == '__main__':
- pprint.pprint(load())
+ import pprint
+ pprint.pprint(cpus())
+ pprint.pprint(overrides())