Why does sched_getaffinity (or sched_setaffinity) return an error on Red Hat Enterprise Linux 6 x86_64?

Updated -

Issue

The Linux system calls sched_getaffinity() and sched_setaffinity() may return an EINVAL (invalid argument) error on x86_64 systems running Red Hat Enterprise Linux 6.  For example, consider the following code snippet:

cpu_set_t mask;

CPU_ZERO(&mask);
if ( sched_getaffinity(0, sizeof(mask), &mask) == -1 )
        perror("sched_getaff...

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In