* The value of pid can be one of the following: *
< -1 | ** wait for any child process whose process group ID is equal to * the absolute value of pid. * | *
-1 | ** wait for any child process; this is the same behaviour that * the wait function exhibits. * | *
0 | ** wait for any child process whose process group ID is equal to * that of the calling process. * | *
> 0 | ** wait for the child whose process ID is equal to the value of * pid. * | *
* Specifying -1 as the pid is * equivalent to the functionality pcntl_wait provides * (minus options). *
* @param int &$status* pcntl_waitpid will store status information * in the status parameter which can be * evaluated using the following functions: * pcntl_wifexited, * pcntl_wifstopped, * pcntl_wifsignaled, * pcntl_wexitstatus, * pcntl_wtermsig and * pcntl_wstopsig. *
* @param int $flags [optional]* The value of options is the value of zero * or more of the following two global constants * OR'ed together: *
WNOHANG | ** return immediately if no child has exited. * | *
WUNTRACED | ** return for children which are stopped, and whose status has * not been reported. * | *
* pcntl_wait will store status information * in the status parameter which can be * evaluated using the following functions: * pcntl_wifexited, * pcntl_wifstopped, * pcntl_wifsignaled, * pcntl_wexitstatus, * pcntl_wtermsig and * pcntl_wstopsig. *
* @param int $flags [optional]* If wait3 is available on your system (mostly BSD-style systems), you can * provide the optional flags parameter. If this * parameter is not provided, wait will be used for the system call. If * wait3 is not available, providing a value for flags * will have no effect. The value of flags * is the value of zero or more of the following two constants * OR'ed together: *
WNOHANG | ** Return immediately if no child has exited. * | *
WUNTRACED | ** Return for children which are stopped, and whose status has * not been reported. * | *
* The signal number. *
* @param callable|int $handler* The signal handler. This may be either a callable, which * will be invoked to handle the signal, or either of the two global * constants SIG_IGN or SIG_DFL, * which will ignore the signal or restore the default signal handler * respectively. *
** If a callable is given, it must implement the following * signature: *
** voidhandler * intsigno * signo * The signal being handled.
* @param bool $restart_syscalls [optional]* Specifies whether system call restarting should be used when this * signal arrives. *
* @return bool TRUE on success or FALSE on failure. */ function pcntl_signal(int $signal, $handler, bool $restart_syscalls = true): bool {} /** * Calls signal handlers for pending signals * @link https://php.net/manual/en/function.pcntl-signal-dispatch.php * @return bool TRUE on success or FALSE on failure. */ function pcntl_signal_dispatch(): bool {} /** * Checks if status code represents a normal exit * @link https://php.net/manual/en/function.pcntl-wifexited.php * @param int $statusThe status * parameter is the status parameter supplied to a successful * call to pcntl_waitpid.
* @return bool TRUE if the child status code represents a normal exit, FALSE * otherwise. */ #[Pure] function pcntl_wifexited(int $status): bool {} /** * Checks whether the child process is currently stopped * @link https://php.net/manual/en/function.pcntl-wifstopped.php * @param int $statusThe status * parameter is the status parameter supplied to a successful * call to pcntl_waitpid.
* @return bool TRUE if the child process which caused the return is * currently stopped, FALSE otherwise. */ #[Pure] function pcntl_wifstopped(int $status): bool {} /** * Checks whether the status code represents a termination due to a signal * @link https://php.net/manual/en/function.pcntl-wifsignaled.php * @param int $statusThe status * parameter is the status parameter supplied to a successful * call to pcntl_waitpid.
* @return bool TRUE if the child process exited because of a signal which was * not caught, FALSE otherwise. */ #[Pure] function pcntl_wifsignaled(int $status): bool {} /** * Returns the return code of a terminated child * @link https://php.net/manual/en/function.pcntl-wexitstatus.php * @param int $statusThe status * parameter is the status parameter supplied to a successful * call to pcntl_waitpid.
* @return int|false the return code, as an integer. */ #[Pure] function pcntl_wexitstatus(int $status): int|false {} /** * @param int $status * @return bool */ #[Pure] function pcntl_wifcontinued(int $status): bool {} /** * Returns the signal which caused the child to terminate * @link https://php.net/manual/en/function.pcntl-wtermsig.php * @param int $statusThe status * parameter is the status parameter supplied to a successful * call to pcntl_waitpid.
* @return int|false the signal number, as an integer. */ #[Pure] function pcntl_wtermsig(int $status): int|false {} /** * Returns the signal which caused the child to stop * @link https://php.net/manual/en/function.pcntl-wstopsig.php * @param int $statusThe status * parameter is the status parameter supplied to a successful * call to pcntl_waitpid.
* @return int|false the signal number. */ #[Pure] function pcntl_wstopsig(int $status): int|false {} /** * Executes specified program in current process space * @link https://php.net/manual/en/function.pcntl-exec.php * @param string $path* path must be the path to a binary executable or a * script with a valid path pointing to an executable in the shebang ( * #!/usr/local/bin/perl for example) as the first line. See your system's * man execve(2) page for additional information. *
* @param array $args* args is an array of argument strings passed to the * program. *
* @param array $env_vars* envs is an array of strings which are passed as * environment to the program. The array is in the format of name => value, * the key being the name of the environmental variable and the value being * the value of that variable. *
* @return bool FALSE on error and does not return on success. */ function pcntl_exec(string $path, array $args = [], array $env_vars = []): bool {} /** * Set an alarm clock for delivery of a signal * @link https://php.net/manual/en/function.pcntl-alarm.php * @param int $seconds* The number of seconds to wait. If seconds is * zero, no new alarm is created. *
* @return int the time in seconds that any previously scheduled alarm had * remaining before it was to be delivered, or 0 if there * was no previously scheduled alarm. */ function pcntl_alarm(int $seconds): int {} /** * Retrieve the error number set by the last pcntl function which failed * @link https://php.net/manual/en/function.pcntl-get-last-error.php * @return int error code. * @since 5.3.4 */ #[Pure(true)] function pcntl_get_last_error(): int {} /** * Alias of pcntl_get_last_error * @link https://php.net/manual/en/function.pcntl-errno.php * @return int error code. * @since 5.3.4 */ #[Pure(true)] function pcntl_errno(): int {} /** * Retrieve the system error message associated with the given errno * @link https://php.net/manual/en/function.pcntl-strerror.php * @param int $error_code*
* @return string|false error description on success or FALSE on failure. * @since 5.3.4 */ #[Pure] #[LanguageLevelTypeAware(["8.0" => "string"], default: "string|false")] function pcntl_strerror(int $error_code): false|string {} /** * Get the priority of any process * @link https://php.net/manual/en/function.pcntl-getpriority.php * @param int|null $process_id [optional]* If not specified, the pid of the current process (getmypid()) is used. *
* @param int $mode [optional]* One of PRIO_PGRP, PRIO_USER * or PRIO_PROCESS. *
* @return int|false pcntl_getpriority returns the priority of the process * or FALSE on error. A lower numerical value causes more favorable * scheduling. */ #[Pure] function pcntl_getpriority(?int $process_id, int $mode = PRIO_PROCESS): int|false {} /** * Change the priority of any process * @link https://php.net/manual/en/function.pcntl-setpriority.php * @param int $priority* priority is generally a value in the range * -20 to 20. The default priority * is 0 while a lower numerical value causes more * favorable scheduling. Because priority levels can differ between * system types and kernel versions, please see your system's setpriority(2) * man page for specific details. *
* @param int|null $process_id [optional]* If not specified, the pid of the current process (getmypid()) is used. *
* @param int $mode [optional]* One of PRIO_PGRP, PRIO_USER * or PRIO_PROCESS. *
* @return bool TRUE on success or FALSE on failure. */ function pcntl_setpriority(int $priority, ?int $process_id, int $mode = PRIO_PROCESS): bool {} /** * Sets and retrieves blocked signals * @link https://php.net/manual/en/function.pcntl-sigprocmask.php * @param int $mode* Sets the behavior of pcntl_sigprocmask. Possible * values: * SIG_BLOCK: Add the signals to the * currently blocked signals. * SIG_UNBLOCK: Remove the signals from the * currently blocked signals. * SIG_SETMASK: Replace the currently * blocked signals by the given list of signals. *
* @param array $signals* List of signals. *
* @param array &$old_signals [optional]* The old_signals parameter is set to an array * containing the list of the previously blocked signals. *
* @return bool TRUE on success or FALSE on failure. */ function pcntl_sigprocmask(int $mode, array $signals, &$old_signals): bool {} /** * Waits for signals * @link https://php.net/manual/en/function.pcntl-sigwaitinfo.php * @param array $signals* Array of signals to wait for. *
* @param array &$info* The info parameter is set to an array containing * informations about the signal. *
** The following elements are set for all signals: * signo: Signal number * errno: An error number * code: Signal code *
** The following elements may be set for the SIGCHLD signal: * status: Exit value or signal * utime: User time consumed * stime: System time consumed * pid: Sending process ID * uid: Real user ID of sending process *
** The following elements may be set for the SIGILL, * SIGFPE, SIGSEGV and * SIGBUS signals: * addr: Memory location which caused fault *
** The following element may be set for the SIGPOLL * signal: * band: Band event * fd: File descriptor number *
* @return int|false On success, pcntl_sigwaitinfo returns a signal number. */ function pcntl_sigwaitinfo(array $signals, &$info = []): int|false {} /** * Waits for signals, with a timeout * @link https://php.net/manual/en/function.pcntl-sigtimedwait.php * @param array $signals* Array of signals to wait for. *
* @param array &$info* The siginfo is set to an array containing * informations about the signal. See * pcntl_sigwaitinfo. *
* @param int $seconds [optional]* Timeout in seconds. *
* @param int $nanoseconds [optional]* Timeout in nanoseconds. *
* @return int|false On success, pcntl_sigtimedwait returns a signal number. */ function pcntl_sigtimedwait(array $signals, &$info = [], int $seconds = 0, int $nanoseconds = 0): int|false {} /** * Enable/disable asynchronous signal handling or return the old setting.* Whether asynchronous signal handling should be enabled. *
* * @return bool * @since 7.1 */ function pcntl_async_signals( #[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] ?bool $enable, #[PhpStormStubsElementAvailable(from: '8.0')] ?bool $enable = null ): bool {} /** * Get the current handler for specified signal. * @link https://www.php.net/manual/en/function.pcntl-signal-get-handler.php * * @param int $signal* The signal number. *
* * @return bool|resource * @since 7.1 */ function pcntl_signal_get_handler(int $signal) {} /** * @param int $flags * @return bool * @since 7.4 */ function pcntl_unshare(int $flags): bool {} define('WNOHANG', 1); define('WUNTRACED', 2); define('WCONTINUED', 8); define('SIG_IGN', 1); define('SIG_DFL', 0); define('SIG_ERR', -1); define('SIGHUP', 1); define('SIGINT', 2); define('SIGQUIT', 3); define('SIGILL', 4); define('SIGTRAP', 5); define('SIGABRT', 6); define('SIGIOT', 6); define('SIGBUS', 7); define('SIGFPE', 8); define('SIGKILL', 9); define('SIGUSR1', 10); define('SIGSEGV', 11); define('SIGUSR2', 12); define('SIGPIPE', 13); define('SIGALRM', 14); define('SIGTERM', 15); define('SIGSTKFLT', 16); define('SIGCLD', 17); define('SIGCHLD', 17); define('SIGCONT', 18); define('SIGSTOP', 19); define('SIGTSTP', 20); define('SIGTTIN', 21); define('SIGTTOU', 22); define('SIGURG', 23); define('SIGXCPU', 24); define('SIGXFSZ', 25); define('SIGVTALRM', 26); define('SIGPROF', 27); define('SIGWINCH', 28); define('SIGPOLL', 29); define('SIGIO', 29); define('SIGPWR', 30); define('SIGSYS', 31); define('SIGBABY', 31); define('PRIO_PGRP', 1); define('PRIO_USER', 2); define('PRIO_PROCESS', 0); /** * @link https://php.net/manual/en/pcntl.constants.php */ define('SIG_BLOCK', 0); /** * @link https://php.net/manual/en/pcntl.constants.php */ define('SIG_UNBLOCK', 1); /** * @link https://php.net/manual/en/pcntl.constants.php */ define('SIG_SETMASK', 2); /** * @link https://php.net/manual/en/pcntl.constants.php */ define('SIGRTMIN', 35); /** * @link https://php.net/manual/en/pcntl.constants.php */ define('SIGRTMAX', 64); /** * @link https://php.net/manual/en/pcntl.constants.php */ define('SI_USER', 0); /** * @link https://php.net/manual/en/pcntl.constants.php */ define('SI_KERNEL', 128); /** * @link https://php.net/manual/en/pcntl.constants.php */ define('SI_QUEUE', -1); /** * @link https://php.net/manual/en/pcntl.constants.php */ define('SI_TIMER', -2); define('SI_MESGQ', -3); /** * @link https://php.net/manual/en/pcntl.constants.php */ define('SI_ASYNCIO', -4); /** * @link https://php.net/manual/en/pcntl.constants.php */ define('SI_SIGIO', -5); /** * @link https://php.net/manual/en/pcntl.constants.php */ define('SI_TKILL', -6); /** * @link https://php.net/manual/en/pcntl.constants.php */ define('CLD_EXITED', 1); /** * @link https://php.net/manual/en/pcntl.constants.php */ define('CLD_KILLED', 2); /** * @link https://php.net/manual/en/pcntl.constants.php */ define('CLD_DUMPED', 3); /** * @link https://php.net/manual/en/pcntl.constants.php */ define('CLD_TRAPPED', 4); /** * @link https://php.net/manual/en/pcntl.constants.php */ define('CLD_STOPPED', 5); /** * @link https://php.net/manual/en/pcntl.constants.php */ define('CLD_CONTINUED', 6); /** * @link https://php.net/manual/en/pcntl.constants.php */ define('TRAP_BRKPT', 1); /** * @link https://php.net/manual/en/pcntl.constants.php */ define('TRAP_TRACE', 2); /** * @link https://php.net/manual/en/pcntl.constants.php */ define('POLL_IN', 1); /** * @link https://php.net/manual/en/pcntl.constants.php */ define('POLL_OUT', 2); /** * @link https://php.net/manual/en/pcntl.constants.php */ define('POLL_MSG', 3); /** * @link https://php.net/manual/en/pcntl.constants.php */ define('POLL_ERR', 4); /** * @link https://php.net/manual/en/pcntl.constants.php */ define('POLL_PRI', 5); /** * @link https://php.net/manual/en/pcntl.constants.php */ define('POLL_HUP', 6); /** * @link https://php.net/manual/en/pcntl.constants.php */ define('ILL_ILLOPC', 1); /** * @link https://php.net/manual/en/pcntl.constants.php */ define('ILL_ILLOPN', 2); /** * @link https://php.net/manual/en/pcntl.constants.php */ define('ILL_ILLADR', 3); /** * @link https://php.net/manual/en/pcntl.constants.php */ define('ILL_ILLTRP', 4); /** * @link https://php.net/manual/en/pcntl.constants.php */ define('ILL_PRVOPC', 5); /** * @link https://php.net/manual/en/pcntl.constants.php */ define('ILL_PRVREG', 6); /** * @link https://php.net/manual/en/pcntl.constants.php */ define('ILL_COPROC', 7); /** * @link https://php.net/manual/en/pcntl.constants.php */ define('ILL_BADSTK', 8); /** * @link https://php.net/manual/en/pcntl.constants.php */ define('FPE_INTDIV', 1); /** * @link https://php.net/manual/en/pcntl.constants.php */ define('FPE_INTOVF', 2); /** * @link https://php.net/manual/en/pcntl.constants.php */ define('FPE_FLTDIV', 3); /** * @link https://php.net/manual/en/pcntl.constants.php */ define('FPE_FLTOVF', 4); /** * @link https://php.net/manual/en/pcntl.constants.php */ define('FPE_FLTUND', 5); /** * @link https://php.net/manual/en/pcntl.constants.php */ define('FPE_FLTRES', 6); /** * @link https://php.net/manual/en/pcntl.constants.php */ define('FPE_FLTINV', 7); /** * @link https://php.net/manual/en/pcntl.constants.php */ define('FPE_FLTSUB', 8); /** * @link https://php.net/manual/en/pcntl.constants.php */ define('SEGV_MAPERR', 1); /** * @link https://php.net/manual/en/pcntl.constants.php */ define('SEGV_ACCERR', 2); /** * @link https://php.net/manual/en/pcntl.constants.php */ define('BUS_ADRALN', 1); /** * @link https://php.net/manual/en/pcntl.constants.php */ define('BUS_ADRERR', 2); /** * @link https://php.net/manual/en/pcntl.constants.php */ define('BUS_OBJERR', 3); define('PCNTL_EINTR', 4); define('PCNTL_ECHILD', 10); define('PCNTL_EINVAL', 22); define('PCNTL_EAGAIN', 11); define('PCNTL_ESRCH', 3); define('PCNTL_EACCES', 13); define('PCNTL_EPERM', 1); define('PCNTL_ENOMEM', 12); define('PCNTL_E2BIG', 7); define('PCNTL_EFAULT', 14); define('PCNTL_EIO', 5); define('PCNTL_EISDIR', 21); define('PCNTL_ELIBBAD', 80); define('PCNTL_ELOOP', 40); define('PCNTL_EMFILE', 24); define('PCNTL_ENAMETOOLONG', 36); define('PCNTL_ENFILE', 23); define('PCNTL_ENOENT', 2); define('PCNTL_ENOEXEC', 8); define('PCNTL_ENOTDIR', 20); define('PCNTL_ETXTBSY', 26); /** * @since 7.4 */ define('PCNTL_ENOSPC', 28); /** * @since 7.4 */ define('PCNTL_EUSERS', 87); /** * @since 7.4 */ define('CLONE_NEWNS', 131072); /** * @since 7.4 */ define('CLONE_NEWIPC', 134217728); /** * @since 7.4 */ define('CLONE_NEWUTS', 67108864); /** * @since 7.4 */ define('CLONE_NEWNET', 1073741824); /** * @since 7.4 */ define('CLONE_NEWPID', 536870912); /** * @since 7.4 */ define('CLONE_NEWUSER', 268435456); /** * @since 7.4 */ define('CLONE_NEWCGROUP', 33554432); // End of pcntl v.