#include<stdio.h>
    #include<unistd.h>

    int main()
    {
    int cpu_num;
    cpu_num = sysconf(_SC_NPROCESSORS_CONF);
    printf("_SC_NPROCESSORS_CONF=%d\n",cpu_num);

    cpu_num = sysconf(_SC_NPROCESSORS_ONLN);
    printf("_SC_NPROCESSORS_ONLN=%d\n",cpu_num);

    return 0;
    }
    /*
    * - _SC_NPROCESSORS_CONF
    * The number of processors configured.
    *
    * - _SC_NPROCESSORS_ONLN
    * The number of processors currently online (available).
    */

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-05-21
  • 2021-07-08
  • 2022-12-23
  • 2022-12-23
  • 2021-07-25
  • 2021-06-23
猜你喜欢
  • 2022-12-23
  • 2021-12-12
  • 2021-09-29
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-11
相关资源
相似解决方案