We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 13411ef + 37fe144 commit e861608Copy full SHA for e861608
1 file changed
ext/pcntl/pcntl.c
@@ -94,7 +94,7 @@ typedef cpuset_t *cpu_set_t;
94
#elif defined(HAVE_PSET_BIND)
95
#include <sys/pset.h>
96
typedef psetid_t cpu_set_t;
97
- #define sched_getaffinity(p, c, m) pset_bind(PS_QUERY, P_PID, (p <= 0 ? getpid() : p), &m)
+ #define sched_getaffinity(p, c, m) pset_bind(PS_QUERY, P_PID, p, &m)
98
#define sched_setaffinity(p, c, m) pset_bind(m, P_PID, (p <= 0 ? getpid() : p), NULL)
99
#define PCNTL_CPUSET(mask) mask
100
#define PCNTL_CPU_ISSET(i, mask) (pset_assign(PS_QUERY, (processorid_t)i, &query) == 0 && query == mask)
0 commit comments