summaryrefslogtreecommitdiff
path: root/TSRM
Commit message (Collapse)AuthorAgeFilesLines
* Fixed bug #80814 (threaded mod_php won't load on FreeBSD: No space available ↵Dmitry Stogov2021-03-102-3/+3
| | | | for static Thread Local Storage)
* Constify char * arguments of APIstwosee2020-06-084-6/+6
| | | | Closes GH-5676.
* Fix warning of strict-prototypestwosee2020-06-072-4/+4
| | | | Closes GH-5673.
* Fix MSVC level 1 (severe) warningsChristoph M. Becker2020-06-052-2/+2
| | | | | | | | | | | | | | | | | | | | | | | We fix (hopefully) all instances of: * <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4005> * <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4024> * <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4028> * <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4047> * <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4087> * <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4090> * <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4273> * <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4312> `zend_llist_add_element()` and `zend_llist_prepend_element()` now explicitly expect a *const* pointer. We use the macro `ZEND_VOIDP()` instead of a `(void*)` cast to suppress C4090; this should prevent accidential removal of the cast by clarifying the intention, and makes it easier to remove the casts if the issue[1] will be resolved sometime. [1] <https://developercommunity.visualstudio.com/content/problem/390711/c-compiler-incorrect-propagation-of-const-qualifie.html>
* Fix [-Wundef] warning in TSRMGeorge Peter Banyard2020-05-201-7/+7
|
* Fix bogus check in TSRM and adjust TSRM_ASSERT macroGeorge Peter Banyard2020-05-181-3/+3
| | | | Closes GH-5562
* utime is always available on WindowsGeorge Peter Banyard2020-05-132-5/+1
| | | | | | Therefore drop useless preprocessor if check Closes GH-5563
* Merge branch 'PHP-7.4'Christoph M. Becker2020-05-051-7/+9
|\ | | | | | | | | * PHP-7.4: Fix #79566: Private SHM is not private on Windows
| * Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2020-05-051-7/+9
| |\ | | | | | | | | | | | | * PHP-7.3: Fix #79566: Private SHM is not private on Windows
| | * Fix #79566: Private SHM is not private on WindowsChristoph M. Becker2020-05-051-7/+9
| | | | | | | | | | | | | | | | | | | | | We map the POSIX semantics of `IPC_PRIVATE` by creating unnamed file mapping objects on Windows. While that is not particularly useful for ext/shmop, which is the only bundled extension which uses `shmget()`, it may be useful for external extensions.
* | | Make quoting of cmd execution functions consistentChristoph M. Becker2020-02-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While the `$command` passed to `proc_open()` had to be wrapped in double-quotes manually, that was implicitly done for all other program execution functions. This could easily introduce bugs and even security issues when switching from one to another program execution function. Furthermore we ensure that the additional quotes are always unwrapped regardless of what is passed as `$command` by passing the `/s` flag to cmd.exe. As it was, `shell_exec('path with spaces/program.exe')` did execute program.exe, but adding an argument (`shell_exec('path with spaces/program.exe -h)`) failed to execute program.exe, because cmd.exe stripped the additional quotes. While these changes obviously can cause BC breaks, we feel that in the long run the benefits of having consistent behavior for all program execution functions outweighs the drawbacks of potentially breaking some code now.
* | | Merge branch 'PHP-7.4'Christoph M. Becker2020-01-031-1/+7
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Fix #78538: shmop memory leak
| * | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2020-01-031-1/+7
| |\ \ | | |/ | | | | | | | | | * PHP-7.3: Fix #78538: shmop memory leak
| | * Fix #78538: shmop memory leakChristoph M. Becker2020-01-031-1/+7
| | | | | | | | | | | | | | | If the descriptor's refcount drops to zero, we have to unmap the respective file view, to avoid leaking memory.
| | * Merge branch 'PHP-7.2' into PHP-7.3Christoph M. Becker2019-08-061-1/+1
| | |\ | | | | | | | | | | | | | | | | * PHP-7.2: Fix #78282: atime and mtime mismatch
| | | * Fix #78282: atime and mtime mismatchChristoph M. Becker2019-08-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The fix for bug #78241 assumed that `time_t` would always be 64bit, but actually is 32bit for x86. We therefore enforce 64bit arithmetic to avoid wrapping. (cherry picked from commit bf242d58e77d50d4d8fdaaaca7ede686ec4467c0)
* | | | Remove mention of PHP major version in Copyright headersGabriel Caruso2019-09-252-4/+0
| | | | | | | | | | | | | | | | Closes GH-4732.
* | | | Make MSVC happy againChristoph M. Becker2019-09-201-1/+5
| | | | | | | | | | | | | | | | | | | | MSVC complains about unsupported preprocessor syntax, so we employ the same workaround as in zend_cpuinfo.h.
* | | | Optimize access to thread local cache.Dmitry Stogov2019-09-181-2/+10
| | | | | | | | | | | | | | | | | | | | This patch saves one CPU instruction on each "_tsrm_ls_cache" access in ZTS CLI/CGI/FPM builds. This reduce typical instruction sequence for EG(current_execute_data) access from 4 to 3 CPU instructions.
* | | | Merge branch 'PHP-7.4'Christoph M. Becker2019-07-131-1/+1
|\ \ \ \ | |/ / / | | | | | | | | | | | | * PHP-7.4: Fix #78282: atime and mtime mismatch
| * | | Fix #78282: atime and mtime mismatchChristoph M. Becker2019-07-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | The fix for bug #78241 assumed that `time_t` would always be 64bit, but actually is 32bit for x86. We therefore enforce 64bit arithmetic to avoid wrapping.
* | | | Merge branch 'PHP-7.4'Peter Kokot2019-07-131-69/+0
|\ \ \ \ | |/ / / | | | | | | | | | | | | * PHP-7.4: Remove tsrm_config_common.h
| * | | Remove tsrm_config_common.hPeter Kokot2019-07-131-69/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - Checks and defines are not relevant for files that include it anymore - Some code is not used anymore - Defines are a bit duplicated in zend_portability.h and TSRM.h file - MAXPATHLEN defs moved to zend_virtual_cwd.h
* | | | Merge branch 'PHP-7.4'Nikita Popov2019-07-123-72/+1
|\ \ \ \ | |/ / /
| * | | Remove unused tsrm_strtok_r() functionNikita Popov2019-07-123-72/+1
| | | | | | | | | | | | | | | | | | | | There is also a php_strtok_r() function, which is actually used, but nothing uses the tsrm_strtok_r() variant...
* | | | Merge branch 'PHP-7.4'Peter Kokot2019-07-103-16/+2
|\ \ \ \ | |/ / / | | | | | | | | | | | | * PHP-7.4: Remove TSRM/tsrm_config.w32.h
| * | | Remove TSRM/tsrm_config.w32.hPeter Kokot2019-07-103-16/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The tsrm_config.w32.h file is a simple wrapper for already defined symbols and includes elsewhere. Closes GH-4383
* | | | Merge branch 'PHP-7.4'Peter Kokot2019-07-051-28/+0
|\ \ \ \ | |/ / / | | | | | | | | | | | | * PHP-7.4: Remove PTHREADS_ASSIGN_VARS
| * | | Remove PTHREADS_ASSIGN_VARSPeter Kokot2019-07-051-28/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This simplifies TSRM build steps a bit and avoids doing unnecessary steps: - The `PTHREADS_CHECK_COMPILE` can called inside the for loops only since this is only where the `$pthreads_checked` variable is used. - Assigning variables can be then done only in the configure.ac once. - use `m4_include()` instead of the `sinclude()` in the middle of the build steps. - The `$threads_result` variable is not used in the code or in extensions.
* | | | Merge branch 'PHP-7.4'Christoph M. Becker2019-07-031-1/+1
|\ \ \ \ | |/ / / | | | | | | | | | | | | * PHP-7.4: Fix #78241: touch() does not handle dates after 2038 in PHP 64-bit
| * | | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2019-07-031-1/+1
| |\ \ \ | | |/ / | | | | | | | | | | | | * PHP-7.3: Fix #78241: touch() does not handle dates after 2038 in PHP 64-bit
| | * | Merge branch 'PHP-7.2' into PHP-7.3Christoph M. Becker2019-07-031-1/+1
| | |\ \ | | | |/ | | | | | | | | | | | | * PHP-7.2: Fix #78241: touch() does not handle dates after 2038 in PHP 64-bit
| | | * Fix #78241: touch() does not handle dates after 2038 in PHP 64-bitChristoph M. Becker2019-07-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | `time_t` defaults to `_time64` (which is 64bit signed) even on x86, but `Int32x32To64()` truncates it to signed 32bit. We replace the macro with the "manual" calculation.
| * | | Remove some old BeOS artefactsPeter Kokot2019-07-021-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - checking for beos systems is no longer relevant in configure.ac - usage of undefined constant BETHREADS removed. Closes GH-4346
* | | | Merge branch 'PHP-7.4'Peter Kokot2019-07-011-8/+0
|\ \ \ \ | |/ / / | | | | | | | | | | | | * PHP-7.4: Remove TSRM_BASIC_CHECKS
| * | | Remove TSRM_BASIC_CHECKSPeter Kokot2019-07-011-8/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This macro is not needed anymore. The AC_PROG_CC is done in the main configure.ac file and the ranlib check is done by the bundled libtool macros. Closes GH-4339
* | | | Merge branch 'PHP-7.4'Peter Kokot2019-06-301-2/+0
|\ \ \ \ | |/ / / | | | | | | | | | | | | * PHP-7.4: Sync functions checks
| * | | Sync functions checksPeter Kokot2019-06-301-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Removed unused checks: - mbsinit check removed, HAVE_MBSINIT removed (not used in php-src) - mempcpy check removed, HAVE_MEMPCPY removed (not used in php-src anymore since 560ed89bfbb56526251e9bd2fbcb27e5932641d8 which uses PHP's own implementation) - strpncpy check removed, added via a8c9e893b6911c785f698d724b2ff61e7aebb737 and not used. - setpgid check removed since HAVE_SETPGID is not used Moved to a central configure.ac: - fpclass - mbrlen moved to configure.ac (since the HAVE_MBRLEN is used accross the php-src) - sigprocmask - getcwd - getwd - glob - strfmon - nice Duplicated checks removed: - gethostname - getlogin - getpwuid_r - socketpair - mprotect check simplified
* | | | Merge branch 'PHP-7.4'Joe Watkins2019-06-282-79/+44
|\ \ \ \ | |/ / / | | | | | | | | | | | | * PHP-7.4: implement tsrm_is_shutdown API
| * | | implement tsrm_is_shutdown APIJoe Watkins2019-06-282-79/+44
| | | |
* | | | Attempt to fix JIT on Mac OSX ZTS buildDmitry Stogov2019-06-171-1/+4
| | | |
* | | | Merge branch 'PHP-7.4'Joe Watkins2019-06-111-7/+3
|\ \ \ \ | |/ / / | | | | | | | | | | | | * PHP-7.4: This reverts 0e5d4ea55554872fe72e5d984b73fc21abc561fe to fix the build on MacOSX
| * | | This reverts 0e5d4ea55554872fe72e5d984b73fc21abc561fe to fix the build on MacOSXJoe Watkins2019-06-111-7/+3
| | | | | | | | | | | | | | | | | | | | | | | | On Mac thread_local and __thread are not ABI compatible, in addition, thread_local comes with additional overhead, __thread seems to be the most suitable linkage to use regardless of c++/c
* | | | Merge branch 'PHP-7.4'Nikita Popov2019-06-041-6/+0
|\ \ \ \ | |/ / /
| * | | Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2019-06-041-6/+0
| |\ \ \ | | |/ /
| | * | Merge branch 'PHP-7.2' into PHP-7.3Nikita Popov2019-06-041-6/+0
| | |\ \ | | | |/
| | | * Reload tsrmls_id in release builds as wellNikita Popov2019-06-041-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | If TSRM is shut down and started again (something that phpdbg does), then tsrmls_id needs to be reloaded everywhere. As tsrmls_id update is a rare operation, doing that shouldn't be a problem.
| | | * Sync leading and final newlines in source code filesPeter Kokot2018-10-143-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds missing newlines, trims multiple redundant final newlines into a single one, and trims redundant leading newlines. According to POSIX, a line is a sequence of zero or more non-' <newline>' characters plus a terminating '<newline>' character. [1] Files should normally have at least one final newline character. C89 [2] and later standards [3] mention a final newline: "A source file that is not empty shall end in a new-line character, which shall not be immediately preceded by a backslash character." Although it is not mandatory for all files to have a final newline fixed, a more consistent and homogeneous approach brings less of commit differences issues and a better development experience in certain text editors and IDEs. [1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206 [2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2 [3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
| | | * Trim trailing whitespace in source code filesPeter Kokot2018-10-134-14/+14
| | | |
| | | * year++Xinchen Hui2018-01-022-2/+2
| | | |