diff options
Diffstat (limited to 'bitbake/lib')
-rw-r--r-- | bitbake/lib/bb/utils.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py index ad13d04331..ebee65d3dd 100644 --- a/bitbake/lib/bb/utils.py +++ b/bitbake/lib/bb/utils.py | |||
@@ -1142,7 +1142,10 @@ def get_referenced_vars(start_expr, d): | |||
1142 | 1142 | ||
1143 | 1143 | ||
1144 | def cpu_count(): | 1144 | def cpu_count(): |
1145 | return multiprocessing.cpu_count() | 1145 | try: |
1146 | return len(os.sched_getaffinity(0)) | ||
1147 | except OSError: | ||
1148 | return multiprocessing.cpu_count() | ||
1146 | 1149 | ||
1147 | def nonblockingfd(fd): | 1150 | def nonblockingfd(fd): |
1148 | fcntl.fcntl(fd, fcntl.F_SETFL, fcntl.fcntl(fd, fcntl.F_GETFL) | os.O_NONBLOCK) | 1151 | fcntl.fcntl(fd, fcntl.F_SETFL, fcntl.fcntl(fd, fcntl.F_GETFL) | os.O_NONBLOCK) |