Commit graph

221 commits

Author SHA1 Message Date
David Carlier
e33de9dda8
Fix pcntl Haiku build
guarding SIGIO constant.

Closes GH-8612.
2022-05-24 14:59:50 +02:00
David Carlier
8b15858c58
Fix GH-8142: Compilation error on cygwin
* pcntl: SIGPOLL/si_band is unsupported
* intl: enable the signal apis with `_POSIX_C_SOURCE`

Closes GH-8146.
2022-03-04 16:20:39 +01:00
Christoph M. Becker
d74c61c133
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #79812: Potential integer overflow in pcntl_exec()
2021-04-12 12:15:07 +02:00
Christoph M. Becker
0a36d417e8
Fix #79812: Potential integer overflow in pcntl_exec()
We use the proper type, and make sure that no overflow can occur by
using `safe_emalloc()` (we can assume that neither string length is
`SIZE_MAX`).

Closes GH-6845.
2021-04-12 12:12:40 +02:00
Nikita Popov
c23eefb1ad Don't leak pcntl last_error across requests 2020-10-22 14:21:22 +02:00
Máté Kocsis
3df306de94
Promote warnings to exceptions in ext/pcntl
Closes GH-6004
2020-08-25 13:02:13 +02:00
Nikita Popov
8fbc618a3c Fix invalid zpp calls in pcntl_get/setpriority 2020-08-13 16:46:02 +02:00
Max Semenik
2b5de6f839
Remove proto comments from C files
Closes GH-5758
2020-07-06 21:13:34 +02:00
Máté Kocsis
596561009c
Fix some UNKNOWN default values
In ext/ffi, ext/intl, ext/mysqli, and ext/pcntl
2020-06-09 09:46:51 +02:00
George Peter Banyard
24de4274f3 Fix [-Wundef] warning in PCNTL extension 2020-05-20 14:01:10 +02:00
Máté Kocsis
4815be44db
Generate function entries from stubs
Converts ext/pcntl, ext/simplexml, ext/snmp, ext/soap, ext/sqlite3.
Closes GH-5421
2020-04-20 10:38:41 +02:00
Nikita Popov
fb718ccc7e Suppress SIG_ERR cast warnings
By casting to void*. I don't want to deal with this right now.
2020-04-15 11:01:12 +02:00
Máté Kocsis
736b22dc0b
Add stubs for aliases
Closes GH-5187
2020-02-18 21:10:36 +01:00
Nikita Popov
6811222422 Eliminate uses of ZVAL_ZVAL and friends
Instead add RETURN_COPY(_VALUE) macros will the expected behavior.

RETURN_ZVAL doesn't make any sense since PHP 7, but has stuck
around, probably because the alternative was to write directly to
the return_value variable.
2020-01-20 10:34:17 +01:00
Máté Kocsis
aadd3aaed9
Use RETURN_THROWS() in various places 2020-01-03 21:10:24 +01:00
Máté Kocsis
7b4a4d2ace
Use RETURN_THROWS() after try_convert_to_string() 2020-01-03 17:04:06 +01:00
Máté Kocsis
345703724c
Use RETURN_THROWS() during ZPP in most of the extensions
Except for some bigger ones: reflection, sodium, spl
2019-12-31 11:46:11 +01:00
Nikita Popov
d011f60eb1 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #78402: pcntl_signal() misleading error message
2019-12-20 11:03:15 +01:00
Nikita Popov
5155097431 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #78402: pcntl_signal() misleading error message
2019-12-20 11:02:57 +01:00
SATO Kentaro
cbb0efaeeb Fix #78402: pcntl_signal() misleading error message
An error message can be misleading when a handler
passed to pcntl_signal() is not callable.
2019-12-20 11:02:20 +01:00
Fabien Villepinte
f67b27fac6 Fix typo in pcntl_sigwaitinfo proto 2019-11-18 12:53:36 +01:00
Máté Kocsis
9493893412 Cleanup return values when parameter parsing is unsuccessful 2019-10-30 16:05:20 +01:00
Nikita Popov
2041c9abf5 Merge branch 'PHP-7.4' 2019-10-02 10:09:37 +02:00
Nikita Popov
e98e1f92c9 Allow SA_RESTART for SIGALRM
If no explicit restart_syscalls is passed, default to
restart_syscalls=0 for SIGALRM only, to reduce BC impact.
2019-10-02 10:09:17 +02:00
Gabriel Caruso
5d6e923d46
Remove mention of PHP major version in Copyright headers
Closes GH-4732.
2019-09-25 14:51:43 +02:00
Craig Duncan
48e696319c Convert pcntl functions arginfo to php stubs 2019-09-20 11:15:22 +02:00
Nikita Popov
99ce142f6e Some pcntl cleanup
Fix some indentation issues and make sure zpp is used consistently.
2019-08-27 17:25:19 +02:00
Nikita Popov
a31f46421d Allow exceptions in __toString()
RFC: https://wiki.php.net/rfc/tostring_exceptions

And convert some object to string conversion related recoverable
fatal errors into Error exceptions.

Improve exception safety of internal code performing string
conversions.
2019-06-05 14:25:07 +02:00
Dmitry Stogov
e188e4170f Use ZEND_TRY_ASSIGN_REF_... macros for arguments passed to internal function by reference 2019-04-24 18:28:29 +03:00
Dmitry Stogov
f1b306fe11 Switch to use ZTS cache 2019-03-12 14:15:47 +03:00
c9s
9f6f6fe219 Remove function_table var from the caller
function_table var is not used in call_user_function macro anymore
hence replace the usage with NULL
2019-03-11 10:00:39 +01:00
Dmitry Stogov
67682356fb Reinstall pcntl tick handler on each request (it cleared after the first request). 2019-02-20 22:36:51 +03:00
Pedro Magalhães
bc54e59a3a Implement pcntl_unshare 2019-02-18 19:20:18 +00:00
Nikita Popov
120137ca14 Merge branch 'PHP-7.3' into PHP-7.4 2019-02-12 10:10:30 +01:00
Nikita Popov
97dd1591af Merge branch 'PHP-7.2' into PHP-7.3 2019-02-12 10:10:22 +01:00
hsldymq
b5cb3ac8ec Make pid & uid available while handling realtime signals 2019-02-12 10:09:33 +01:00
Peter Kokot
92ac598aab Remove local variables
This patch removes the so called local variables defined per
file basis for certain editors to properly show tab width, and
similar settings. These are mainly used by Vim and Emacs editors
yet with recent changes the once working definitions don't work
anymore in Vim without custom plugins or additional configuration.
Neither are these settings synced across the PHP code base.

A simpler and better approach is EditorConfig and fixing code
using some code style fixing tools in the future instead.

This patch also removes the so called modelines for Vim. Modelines
allow Vim editor specifically to set some editor configuration such as
syntax highlighting, indentation style and tab width to be set in the
first line or the last 5 lines per file basis. Since the php test
files have syntax highlighting already set in most editors properly and
EditorConfig takes care of the indentation settings, this patch removes
these as well for the Vim 6.0 and newer versions.

With the removal of local variables for certain editors such as
Emacs and Vim, the footer is also probably not needed anymore when
creating extensions using ext_skel.php script.

Additionally, Vim modelines for setting php syntax and some editor
settings has been removed from some *.phpt files.  All these are
mostly not relevant for phpt files neither work properly in the
middle of the file.
2019-02-03 21:03:00 +01:00
Zeev Suraski
0cf7de1c70 Remove yearly range from copyright notice 2019-01-30 11:03:12 +02:00
Nikita Popov
e219ec144e Implement typed properties
RFC: https://wiki.php.net/rfc/typed_properties_v2

This is a squash of PR #3734, which is a squash of PR #3313.

Co-authored-by: Bob Weinand <bobwei9@hotmail.com>
Co-authored-by: Joe Watkins <krakjoe@php.net>
Co-authored-by: Dmitry Stogov <dmitry@zend.com>
2019-01-11 15:49:06 +01:00
Peter Kokot
902d39a3a7 Trim trailing whitespace in source code files 2018-10-13 14:14:50 +02:00
Peter Kokot
8d3f8ca12a Remove unused Git attributes ident
The $Id$ keywords were used in Subversion where they can be substituted
with filename, last revision number change, last changed date, and last
user who changed it.

In Git this functionality is different and can be done with Git attribute
ident. These need to be defined manually for each file in the
.gitattributes file and are afterwards replaced with 40-character
hexadecimal blob object name which is based only on the particular file
contents.

This patch simplifies handling of $Id$ keywords by removing them since
they are not used anymore.
2018-07-25 00:53:25 +02:00
Dmitry Stogov
265c3ed6cf Fixed incorrrecr zval_dtor() usage to replace value of argument passed by reference, that may lead to memory leaks. 2018-07-05 10:57:49 +03:00
Dmitry Stogov
0b90cf85a6 Removed "dead" code (zend_hash_update() never fails) 2018-06-01 11:58:57 +03:00
Dmitry Stogov
d90c6f2443 Removed useless zval_ptr_dtor() 2018-05-29 17:58:06 +03:00
Dmitry Stogov
5eb1f92f31 Use zend_string_release_ex() instread of zend_string_release() in places, where we sure about string persistence. 2018-05-28 16:27:12 +03:00
Bob Weinand
dfa383497a Merge remote-tracking branch 'origin/PHP-7.2' 2018-02-28 02:36:18 +01:00
Bob Weinand
15d611e451 Merge branch 'PHP-7.1' into PHP-7.2 2018-02-28 02:35:44 +01:00
Bob Weinand
3f32bd9f43 Fix pcntl build on mac
Apparently on mac WIF*(x) macros resolve to (*(int*)&x) (_W_INT macro in sys/wait.h), forcing the value to be a lvalue
2018-02-28 02:13:28 +01:00
Christoph M. Becker
94d0c24dca Merge branch 'PHP-7.2'
* PHP-7.2:
  Fix #75873: pcntl_wexitstatus returns incorrect on Big_Endian platform (s390x)
2018-02-23 23:53:32 +01:00
Christoph M. Becker
32df2b6617 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix #75873: pcntl_wexitstatus returns incorrect on Big_Endian platform (s390x)
2018-02-23 23:52:07 +01:00