_GNU_SOURCE and __USE_GNU

前端 未结 2 483
清酒与你
清酒与你 2020-12-01 10:32

I want to use CPU_SET, which is a glibc linux-specific macro that should be defined in sched.h The manpage clearly states that _GNU_SOURCE

2条回答
  •  情书的邮戳
    2020-12-01 11:24

    you have to define_GNU_SOURCE before anything else. This snippet works here:

    #define _GNU_SOURCE
    #include 
    
    
    int main()
    {
        cpu_set_t set;
        CPU_SET(0, &set);
        return 0;
    }
    

提交回复
热议问题