1
0
mirror of https://github.com/php/php-src.git synced 2026-03-30 20:22:36 +02:00
Commit Graph

478 Commits

Author SHA1 Message Date
David Carlier
b8115d6c5e Fix GH-16769: php_pcntl_set_user_signal_infos aborts when a signal is a reference.
close GH-16772
2024-11-13 12:11:43 +00:00
DanielEScherzer
5dd0575698 Generated arginfo header files: combine preprocessor conditional blocks (#15736)
When functions' or class methods' availability is based on some preprocessor
condition, the generated arginfo header files wrap the declarations in the
preprocessor `#if` conditional blocks, one per declaration, even if they are in
the same conditional block based on comments in the stub file. Instead of
having multiple conditional blocks one after the other with the same condition,
combine them into a single conditional block.
2024-09-04 13:04:22 +02:00
Peter Kokot
13f041163c Remove Travis artefacts (#15714)
Travis was suspended https://github.com/php/php-src/pull/15314

This removes 404 errored Travis image in README, travis configuration
directory and YAML file and usages in tests.

[skip ci]

Co-authored-by: Gina Peter Banyard <girgias@php.net>
2024-09-04 01:15:10 +02:00
DanielEScherzer
53cb89670c Generated arginfo header files: remove empty zend_function_entry arrays (#15705)
When a class (or enum) has no methods, rather than using an array that only
contains `ZEND_FE_END`, use `NULL` for the functions. The implementation of
class registration for internal classes, `do_register_internal_class()` in
zend_API.c, already skips classes where the functions are `NULL`. By removing
these unneeded arrays, we can reduce the size of the header files, while also
removing an unneeded call to zend_register_functions() for each internal class
with no extra methods.
2024-09-03 23:19:53 +02:00
Gina Peter Bnayard
5853cdb73d Use "must not" instead of "cannot" wording 2024-08-21 21:12:17 +01:00
Gina Peter Bnayard
c811d58953 ext/pcntl: Use standard wording for ValueError 2024-08-21 21:12:17 +01:00
Gina Peter Bnayard
e7c4d54d65 Use new helper function for "cannot be empty" ValueErrors 2024-08-21 21:12:17 +01:00
Peter Kokot
f2e50eb61f Autotools: Sync CS in ext/pcntl (#15341)
- AC_CHECK_TYPE long list of arguments split into a newline
- Long lists in AC_CHECK_DECLS can be split across multiple lines, even
  without m4_normalize, but the end quote needs to be done properly
  after the last item without space or newline. Here the m4_normalize
  ensures all trailing blanks are trimmed and having the possibility to
  put the ending quotes on newlines also
2024-08-11 15:12:37 +02:00
Peter Kokot
dcdcb3cbfe Autotools: Replace AC_MSG_ERROR with AC_MSG_FAILURE (#15209)
This replaces the AC_MSG_ERROR with AC_MSG_FAILURE, where appropriate.

The AC_MSG_ERROR outputs given message and exits the configure step. The
AC_MSG_FAILURE does the same but also automatically outputs additional
message "See 'config.log' for more details." which might help directing
the user where to look further.

The AC_MSG_ERROR is used for errors where current test step isn't logged
in the config.log and wouldn't make sense, and AC_MSG_FAILURE is mostly
used in cases of library checks, compilation tests, headers checked with
AC_CHECK_HEADER* and similar tests that are also logged in the
config.log.

AC_MSG_ERROR([Sanity check failed.]) output:

```
configure: error: Sanity check failed.
```

AC_MSG_FAILURE([Sanity check failed.]) output:

```
configure: error: in '/path/to/php-src':
configure: error: Sanity check failed.
See 'config.log' for more details
```
2024-08-04 07:36:37 +02:00
Peter Kokot
16d9bd0aae Sync AC_DEFINE help texts (#15207) 2024-08-03 09:47:39 +02:00
Peter Kokot
1ceadaed52 Autotools: Normalize and quote all PHP_NEW_EXTENSION arguments (#15144)
This adds Autoconf quote characters to all PHP_NEW_EXTENSION arguments
and syncs the CS across the php-src Autotools build system.
2024-07-29 00:14:59 +02:00
David Carlier
17cf7b381a ext/pcntl adding Pcntl namespace for Qos class.
Close GH-14892
2024-07-10 19:15:04 +01:00
Vladimir Vrzić
c2fd071db7 ext/pcntl: Added new function pcntl_waitid
to obtain status information pertaining termination, stop, and/or
continue events in one the caller's child processes.

close GH-14617
2024-07-07 11:04:14 +01:00
Peter Kokot
c44834d8ad Trim trailing whitespace (#14721) 2024-06-29 18:41:45 +02:00
Arnaud Le Blanc
11accb5cdf Preferably include from build dir (#13516)
* Include from build dir first

This fixes out of tree builds by ensuring that configure artifacts are included
from the build dir.

Before, out of tree builds would preferably include files from the src dir, as
the include path was defined as follows (ignoring includes from ext/ and sapi/) :

    -I$(top_builddir)/main
    -I$(top_srcdir)
    -I$(top_builddir)/TSRM
    -I$(top_builddir)/Zend
    -I$(top_srcdir)/main
    -I$(top_srcdir)/Zend
    -I$(top_srcdir)/TSRM
    -I$(top_builddir)/

As a result, an out of tree build would include configure artifacts such as
`main/php_config.h` from the src dir.

After this change, the include path is defined as follows:

    -I$(top_builddir)/main
    -I$(top_builddir)
    -I$(top_srcdir)/main
    -I$(top_srcdir)
    -I$(top_builddir)/TSRM
    -I$(top_builddir)/Zend
    -I$(top_srcdir)/Zend
    -I$(top_srcdir)/TSRM

* Fix extension include path for out of tree builds

* Include config.h with the brackets form

`#include "config.h"` searches in the directory containing the including-file
before any other include path. This can include the wrong config.h when building
out of tree and a config.h exists in the source tree.

Using `#include <config.h>` uses exclusively the include path, and gives
priority to the build dir.
2024-06-26 00:26:43 +02:00
Gina Peter Banyard
fd2d869642 Clean-up some more headers (#14416)
Remove unused headers (such as php_ini.h for extensions that don't define INI settings)
Use more specific headers when possible
2024-06-08 17:15:36 +01:00
Peter Kokot
cfb739585f Check ext/pcntl required functions with for loop (#14302)
This omits defining redundant HAVE_<function> symbols since these are
used unconditionally in ext/pcntl.

* HAVE_FORK is defined via ext/standard/config.m4
* HAVE_SIGACTION is defined via Zend.m4
* HAVE_WAITPID symbol is removed
2024-06-07 22:49:02 +02:00
Gina Peter Banyard
2fa3e8094c ext/pcntl: Fix [-Wsign-compare] warnings 2024-06-06 16:18:23 +01:00
Peter Kokot
6e1d20c86f Wrap sched_getcpu AC_RUN_IFELSE check in AC_CACHE_CHECK (#14336)
For cross-compiling configuration, this wraps the check with the
php_cv_func_sched_getcpu variable.
2024-05-27 13:40:18 +02:00
David Carlier
fe7f699c0a ext/pcntl: adding SIGTRAP handling for freebsd.
if a restricted file descriptor based syscall by the system had been attempted,
a SIGTRAP is raised with the syscall id.

close GH-14266
2024-05-22 18:40:58 +01:00
Peter Kokot
0927651593 Simplify required functions checks in ext/pcntl (#14288) 2024-05-21 14:53:52 +02:00
David CARLIER
4ed1835f00 ext/pcntl: cpu affinity support for solaris/illumos. (#14199) 2024-05-15 19:43:27 +01:00
David Carlier
19c8a10f3f ext/pcntl: add pcntl_getcpu support for solaris.
using getcpuid having similar signature too.

close GH-14188
2024-05-11 05:53:10 +01:00
David CARLIER
32936c518a ext/pcntl: porting pcntl cpu affinity api to netbsd. (#14056) 2024-04-29 13:54:07 +01:00
David Carlier
3a300e9213 ext/pcntl: signals list update for dragonflybsd related to checkpoint.
- SIGCKPT checkpoint and continue.
- SIGCKPTEXIT checkpoint and exit.

Close GH-14011
2024-04-22 21:21:52 +01:00
David CARLIER
23640542dc ext/pcntl: pcntl_fork refining error handling. (#14021) 2024-04-20 21:01:09 +01:00
David Carlier
d40726670f ext/pcntl: pcntl_getqos_class/pcntl_setqos_class addition.
Introducting macOs Quality Of Service through those two calls.
on macOs arm64/M*, there is no concept of individual cores, thus
the old thread policy for cpu affinity does not work here.
Instead, the user can apply to the current process the level of
 performance/energy consumption they wish from the highest
QosClass::UserInteractive to QosClass::Background.

Close GH-13945
2024-04-15 18:52:28 +01:00
Dmitry Stogov
a37d661db5 Fix false positive test failure 2024-04-10 09:01:46 +03:00
David CARLIER
7c860628cd ext/pcntl: getpriority/setpriority who default value handling change. (#13911)
0 refers to the calling process, all across unixes, thus saving one
syscall.
2024-04-07 22:30:48 +01:00
David Carlier
d8f2900574 ext/pcntl: adding pcntl_getcpu.
using sched_getcpu under the hood (Linux and FreeBSD).
Returns the current cpu id for the current process.
For Linux, we need to see beyond the sole presence of the symbol
to consider it.
Mostly useful, for now, in the cpu affinity context since
the os can migrate processes as it sees fits otherwise.

Clos GH-13908
2024-04-07 20:05:03 +01:00
David CARLIER
dd2ffaab2c ext/pcntl: pcntl affinity improves EINVAL handling in both cases. (#13907)
also disable tests on travis.
2024-04-07 16:43:36 +01:00
David Carlier
01817e99ab ext/pcntl pcntl_signal_get_handler update.
The situation varies from platform to another, thus taking in
account the complexity of it.

Close GH-13902
2024-04-07 13:25:45 +01:00
David Carlier
1cf8291c85 ext/pcntl: cpu affinity api introduction.
For now, working on Linux, FreeBSD >= 13.x and DragonFlyBSD.
Handy wrapper to assign an array of cpu ids or to retrieve the cpu ids
assigned to a given process.

pcntl_setaffinity inserts valid unique cpu ids (within the range of available
cpus).

Close GH-13893
2024-04-07 00:56:54 +01:00
David CARLIER
2508138532 ext/pcntl: pcnt_setns few nitpicks changes. (#13885) 2024-04-04 21:05:35 +01:00
David Carlier
ae4978a139 ext/pcntl: adding pcntl_setns for Linux >= 5.3
allows a given process to join an existing Linux namespace, relatively
complementary to the existing pcntl_unshare.

Close GH-13878
2024-04-04 18:45:15 +01:00
David CARLIER
7db7c420f1 ext/pcntl: pcntl_unshare minor error message clarification (for EINVAL). (#13872)
it is not necessarily a bad flag but can just be unsupported by the
current kernel.
2024-04-02 23:26:07 +01:00
Máté Kocsis
f2e199e878 Implement "support doc comments for internal classes and functions" (#13266)
Fixes #13130
2024-02-25 08:41:31 +01:00
Máté Kocsis
10957e498c Do not generate frameless info items when func info generation is disabled
While here, I fixed newlines around arginfo and function entry generation. Previously, newlines were repeated.
2024-02-18 11:39:00 +01:00
Peter Kokot
1e770d12c2 Use Autoconf AC_CHECK_TYPE for checking siginfo_t (#13389)
The siginfo_t is defined by including the signal.h. Some systems include
the siginfo.h in the signal.h. Including it separately is obsolete on
current systems.
2024-02-14 13:56:24 +01:00
divinity76
6d0a3e86f0 [skip ci] accidentally used print() instead of die() (#13158) 2024-01-17 01:40:04 +01:00
Gina Peter Banyard
1bdb0fddc1 Refactor pcntl_sigprocmask()/pcntl_sigwaitinfo()/pcntl_sigtimedwait() (#11860) 2023-11-16 00:40:18 +00:00
Niels Dossche
5465cea8c8 Remove unused variable 'error' (#12438)
Will also get rid of the potential allocation happening in
zend_is_callable_ex().
2023-10-15 18:24:18 +02:00
Ilija Tovilo
60722b9773 Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix getpriority test with negative return value
2023-09-22 10:26:17 +02:00
Ilija Tovilo
8eb740b432 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix getpriority test with negative return value
2023-09-22 10:26:10 +02:00
Ilija Tovilo
645ea22390 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix getpriority test with negative return value
2023-09-22 10:26:01 +02:00
Ilija Tovilo
181598d403 Fix getpriority test with negative return value
Negative return values are valid and denote higher priority.

https://man7.org/linux/man-pages/man2/setpriority.2.html
2023-09-22 10:25:15 +02:00
George Peter Banyard
bc4807c506 ext/pcntl: Remove useless call to zend_get_callable_name() (#12241)
Result of it is unused
2023-09-18 17:35:36 +01:00
Niels Dossche
633e7455e5 Merge branch 'PHP-8.2'
* PHP-8.2:
  Revert the fix for GH-11498
2023-08-03 21:59:35 +02:00
Niels Dossche
c59bfc8d98 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Revert the fix for GH-11498
2023-08-03 21:59:21 +02:00
Niels Dossche
f7be15dbad Revert the fix for GH-11498
People relied on manually waiting for children, but the fix for GH-11498
broke this. Fixing this in PHP is fundamentally incompatible with doing
the wait loop in userland. This reverts to the old behaviour.

Closes GH-11863.
2023-08-03 21:48:34 +02:00