isn't nproc(1) just a call to sysconf(3) with either _SC_NPROCESSORS_ONLN for regular behavior, or _SC_NPROCESSORS_CONF for --all? that works fine for macOS too...