Skip to content

Commit 37fe144

Browse files
committed
Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4: ext/pcntl: fix pcntl_getcpuaffinity() for solaris.
2 parents ded206e + 5faa54d commit 37fe144

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ PHP NEWS
3333
. Fixed bug GH-20674 (mb_decode_mimeheader does not handle separator).
3434
(Yuya Hamada)
3535

36+
- PCNTL:
37+
. Fixed bug with pcntl_getcpuaffinity() on solaris regarding invalid
38+
process ids handling. (David Carlier)
39+
3640
- Phar:
3741
. Fixed bug GH-20732 (Phar::LoadPhar undefined behavior when reading fails).
3842
(ndossche)

ext/pcntl/pcntl.c

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

0 commit comments

Comments
 (0)