Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 15 additions & 10 deletions ext/standard/proc_open.c
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
/*
+----------------------------------------------------------------------+
| Copyright (c) The PHP Group |
| Copyright © The PHP Group and Contributors. |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| https://www.php.net/license/3_01.txt |
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
| This source file is subject to the Modified BSD License that is |
| bundled with this package in the file LICENSE, and is available |
| through the World Wide Web at <https://www.php.net/license/>. |
| |
| SPDX-License-Identifier: BSD-3-Clause |
+----------------------------------------------------------------------+
| Author: Wez Furlong <wez@thebrainroom.com> |
+----------------------------------------------------------------------+
Expand Down Expand Up @@ -44,10 +42,17 @@
* to be really buggy.
*/
#include <spawn.h>
#ifdef __APPLE__
#include <AvailabilityMacros.h>
#endif
#define USE_POSIX_SPAWN

/* The non-_np variant is in macOS 26 (and _np deprecated) */
#ifdef HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR
#if defined(__APPLE__) && MAC_OS_X_VERSION_MIN_REQUIRED >= 260000
#define POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR posix_spawn_file_actions_addchdir
#elif defined(__APPLE__) && MAC_OS_X_VERSION_MIN_REQUIRED < 260000
#define POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR posix_spawn_file_actions_addchdir_np
#elif HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR
#define POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR posix_spawn_file_actions_addchdir
#else
#define POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR posix_spawn_file_actions_addchdir_np
Expand Down Expand Up @@ -1573,4 +1578,4 @@ PHP_FUNCTION(proc_open)
}
/* }}} */

#endif /* PHP_CAN_SUPPORT_PROC_OPEN */
#endif /* PHP_CAN_SUPPORT_PROC_OPEN */
Loading