Index: lib/libc/gen/sched_getaffinity.c =================================================================== --- lib/libc/gen/sched_getaffinity.c +++ lib/libc/gen/sched_getaffinity.c @@ -38,9 +38,11 @@ sched_getaffinity(pid_t pid, size_t cpusetsz, cpuset_t *cpuset) { cpuwhich_t which; - int error; + int error, osrel; - if (__getosreldate() < P_OSREL_TIDPID) { + osrel = __getosreldate(); + if ((P_OSREL_MAJOR(osrel) > P_OSREL_MAJOR(__FreeBSD_version)) || + osrel < P_OSREL_TIDPID) { if (pid == 0 || pid > _PID_MAX) which = CPU_WHICH_TID; else Index: lib/libc/gen/sched_setaffinity.c =================================================================== --- lib/libc/gen/sched_setaffinity.c +++ lib/libc/gen/sched_setaffinity.c @@ -41,10 +41,12 @@ static int mp_maxid; cpuwhich_t which; cpuset_t c; - int error, lbs, cpu; + int error, lbs, cpu, osrel; size_t len, sz; - if (__getosreldate() < P_OSREL_TIDPID) { + osrel = __getosreldate(); + if ((P_OSREL_MAJOR(osrel) > P_OSREL_MAJOR(__FreeBSD_version)) || + osrel < P_OSREL_TIDPID) { if (pid == 0 || pid > _PID_MAX) which = CPU_WHICH_TID; else Index: sys/sys/param.h =================================================================== --- sys/sys/param.h +++ sys/sys/param.h @@ -91,7 +91,7 @@ #define P_OSREL_CK_SUPERBLOCK 1300000 #define P_OSREL_CK_INODE 1300005 #define P_OSREL_POWERPC_NEW_AUX_ARGS 1300070 -#define P_OSREL_TIDPID 1400079 +#define P_OSREL_TIDPID 1302501 #define P_OSREL_MAJOR(x) ((x) / 100000) #endif