|
46 | 46 | #if defined(ZTS) && defined(HAVE_TIMER_CREATE)
|
47 | 47 | #include <time.h>
|
48 | 48 | #include <sys/syscall.h>
|
| 49 | +#include <sys/types.h> |
49 | 50 | // Musl Libc defines this macro, glibc does not
|
50 | 51 | // According to "man 2 timer_create" this field should always be available, but it's not
|
51 | 52 | # ifndef sigev_notify_thread_id
|
@@ -185,10 +186,10 @@ void init_executor(void) /* {{{ */
|
185 | 186 | sev.sigev_notify = SIGEV_THREAD_ID;
|
186 | 187 | sev.sigev_value.sival_ptr = &EG(timer);
|
187 | 188 | sev.sigev_signo = SIGIO;
|
188 |
| - sev.sigev_notify_thread_id = syscall(SYS_gettid); |
| 189 | + sev.sigev_notify_thread_id = (pid_t) syscall(SYS_gettid); |
189 | 190 |
|
190 | 191 | if (timer_create(CLOCK_THREAD_CPUTIME_ID, &sev, &EG(timer)) != 0)
|
191 |
| - fprintf(stderr, "error %d while creating timer on thread %d\n", errno, syscall(SYS_gettid)); |
| 192 | + fprintf(stderr, "error %d while creating timer on thread %d\n", errno, (pid_t) syscall(SYS_gettid)); |
192 | 193 | # ifdef TIMER_DEBUG
|
193 | 194 | else fprintf(stderr, "timer created on thread %d\n", syscall(SYS_gettid));
|
194 | 195 | # endif
|
@@ -421,9 +422,9 @@ void shutdown_executor(void) /* {{{ */
|
421 | 422 |
|
422 | 423 | #if defined(ZTS) && defined(HAVE_TIMER_CREATE)
|
423 | 424 | if (timer_delete(EG(timer)) != 0)
|
424 |
| - fprintf(stderr, "error %d while deleting timer on thread %d\n", errno, syscall(SYS_gettid)); |
| 425 | + fprintf(stderr, "error %d while deleting timer on thread %d\n", errno, (pid_t) syscall(SYS_gettid)); |
425 | 426 | # ifdef TIMER_DEBUG
|
426 |
| - else fprintf(stderr, "timer deleted on thread %d\n", syscall(SYS_gettid)); |
| 427 | + else fprintf(stderr, "timer deleted on thread %d\n", (pid_t) syscall(SYS_gettid)); |
427 | 428 | # endif
|
428 | 429 | #endif
|
429 | 430 |
|
@@ -1349,7 +1350,7 @@ ZEND_API ZEND_NORETURN void ZEND_FASTCALL zend_timeout(void) /* {{{ */
|
1349 | 1350 | static void zend_timeout_handler(int dummy, siginfo_t *si, void *uc) /* {{{ */
|
1350 | 1351 | {
|
1351 | 1352 | if (si->si_value.sival_ptr != &EG(timer)) {
|
1352 |
| - fprintf(stderr, "ignoring timeout signal SIGIO received on thread %d\n", syscall(SYS_gettid)); |
| 1353 | + fprintf(stderr, "ignoring timeout signal SIGIO received on thread %d\n", (pid_t) syscall(SYS_gettid)); |
1353 | 1354 |
|
1354 | 1355 | return;
|
1355 | 1356 | }
|
@@ -1466,12 +1467,12 @@ static void zend_set_timeout_ex(zend_long seconds, bool reset_signals) /* {{{ */
|
1466 | 1467 | its.it_interval.tv_nsec = 0;
|
1467 | 1468 |
|
1468 | 1469 | if (timer_settime(timer, 0, &its, NULL) != 0) {
|
1469 |
| - fprintf(stderr, "unable to set timer on thread %d\n", syscall(SYS_gettid)); |
| 1470 | + fprintf(stderr, "unable to set timer on thread %d\n", (pid_t) syscall(SYS_gettid)); |
1470 | 1471 |
|
1471 | 1472 | return;
|
1472 | 1473 | }
|
1473 | 1474 | # ifdef TIMER_DEBUG
|
1474 |
| - else fprintf(stderr, "timer set on thread %d (%ld seconds)\n", syscall(SYS_gettid), seconds); |
| 1475 | + else fprintf(stderr, "timer set on thread %d (%ld seconds)\n", (pid_t) syscall(SYS_gettid), seconds); |
1475 | 1476 | # endif
|
1476 | 1477 |
|
1477 | 1478 | if (reset_signals) {
|
|
0 commit comments