--- ./lib/os.js.orig	2022-05-21 13:09:26.332384353 +0530
+++ ./lib/os.js	2022-05-21 13:10:15.732384334 +0530
@@ -45,6 +45,7 @@
 const { validateInt32 } = require('internal/validators');
 
 const {
+  getNumCPUs,
   getCPUs,
   getFreeMem,
   getHomeDirectory: _getHomeDirectory,
@@ -114,6 +115,10 @@
   return [avgValues[0], avgValues[1], avgValues[2]];
 }
 
+function numcpus() {
+  return getNumCPUs();
+}
+
 /**
  * Returns an array of objects containing information about each
  * logical CPU core.
@@ -183,7 +188,7 @@
     path = safeGetenv('TMPDIR') ||
            safeGetenv('TMP') ||
            safeGetenv('TEMP') ||
-           '/tmp';
+           '@TERMUX_PREFIX@/tmp';
     if (path.length > 1 && StringPrototypeEndsWith(path, '/'))
       path = StringPrototypeSlice(path, 0, -1);
   }
@@ -351,6 +356,7 @@
 
 module.exports = {
   arch,
+  numcpus,
   cpus,
   endianness,
   freemem: getFreeMem,
