• R
    fix undefined behavior in sched.h cpu_set_t usage · 66570ec9
    Rich Felker 提交于
    since cpu sets can be dynamically allocated and have variable size,
    accessing their contents via ->__bits is not valid; performing pointer
    arithmetic outside the range of the size of the declared __bits array
    results in undefined beahavior. instead, only use cpu_set_t for
    fixed-size cpu set objects (instantiated by the caller) and as an
    abstract pointer type for dynamically allocated ones. perform all
    accesses simply by casting the abstract pointer type cpuset_t * back
    to unsigned long *.
    66570ec9
sched.h 4.1 KB