Skip to content

Commit 63b9ef4

Browse files
committed
ext/pcntl: fix pcntl_getcpuaffinity() for solaris.
trusting the call to handle invalid process id via errnos. see php#20709 (comment) for rationale.
1 parent bf63341 commit 63b9ef4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ext/pcntl/pcntl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ typedef cpuset_t *cpu_set_t;
9393
#elif defined(HAVE_PSET_BIND)
9494
#include <sys/pset.h>
9595
typedef psetid_t cpu_set_t;
96-
#define sched_getaffinity(p, c, m) pset_bind(PS_QUERY, P_PID, (p <= 0 ? getpid() : p), &m)
96+
#define sched_getaffinity(p, c, m) pset_bind(PS_QUERY, P_PID, p, &m)
9797
#define sched_setaffinity(p, c, m) pset_bind(m, P_PID, (p <= 0 ? getpid() : p), NULL)
9898
#define PCNTL_CPUSET(mask) mask
9999
#define PCNTL_CPU_ISSET(i, mask) (pset_assign(PS_QUERY, (processorid_t)i, &query) == 0 && query == mask)

0 commit comments

Comments
 (0)