No, cpu_set_t is a POD without any default-initialization. Clearing it via CPU_ZERO before setting with CPU_SET is correct.
[EDIT]: No, I was wrong and right as well. Initializing with = {} enables default-initialization of the POD's members, but it isn't guaranteed that this is the same as doing CPU_ZERO. So you should still stick with CPU_ZERO.
[EDIT]: No, I was wrong and right as well. Initializing with = {} enables default-initialization of the POD's members, but it isn't guaranteed that this is the same as doing CPU_ZERO. So you should still stick with CPU_ZERO.
Comment