Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102670821
D38677.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D38677.diff
View Options
diff --git a/lib/libc/gen/sched_getaffinity.c b/lib/libc/gen/sched_getaffinity.c
--- a/lib/libc/gen/sched_getaffinity.c
+++ b/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 (osrel < P_OSREL_TIDPID_13 || (osrel < P_OSREL_TIDPID &&
+ P_OSREL_MAJOR(osrel) == P_OSREL_MAJOR(P_OSREL_TIDPID))) {
if (pid == 0 || pid > _PID_MAX)
which = CPU_WHICH_TID;
else
diff --git a/lib/libc/gen/sched_setaffinity.c b/lib/libc/gen/sched_setaffinity.c
--- a/lib/libc/gen/sched_setaffinity.c
+++ b/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 (osrel < P_OSREL_TIDPID_13 || (osrel < P_OSREL_TIDPID &&
+ P_OSREL_MAJOR(osrel) == P_OSREL_MAJOR(P_OSREL_TIDPID))) {
if (pid == 0 || pid > _PID_MAX)
which = CPU_WHICH_TID;
else
diff --git a/sys/sys/param.h b/sys/sys/param.h
--- a/sys/sys/param.h
+++ b/sys/sys/param.h
@@ -92,6 +92,7 @@
#define P_OSREL_CK_INODE 1300005
#define P_OSREL_POWERPC_NEW_AUX_ARGS 1300070
#define P_OSREL_TIDPID 1400079
+#define P_OSREL_TIDPID_13 1302501
#define P_OSREL_MAJOR(x) ((x) / 100000)
#endif
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 16, 3:45 PM (21 h, 4 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14660838
Default Alt Text
D38677.diff (1 KB)
Attached To
Mode
D38677: cpuset: Adapt sched_affinity compat shims to the stable/13
Attached
Detach File
Event Timeline
Log In to Comment