xref: /PHP-8.1/ext/pcntl/pcntl.stub.php (revision 660585e2)
1<?php
2
3/** @generate-class-entries */
4
5function pcntl_fork(): int {}
6
7/**
8 * @param int $status
9 * @param array $resource_usage
10 */
11function pcntl_waitpid(int $process_id, &$status, int $flags = 0, &$resource_usage = []): int {}
12
13/**
14 * @param int $status
15 * @param array $resource_usage
16 */
17function pcntl_wait(&$status, int $flags = 0, &$resource_usage = []): int {}
18
19/** @param callable|int $handler */
20function pcntl_signal(int $signal, $handler, bool $restart_syscalls = true): bool {}
21
22/** @return callable|int */
23function pcntl_signal_get_handler(int $signal) {}
24
25function pcntl_signal_dispatch(): bool {}
26
27#ifdef HAVE_SIGPROCMASK
28/** @param array $old_signals */
29function pcntl_sigprocmask(int $mode, array $signals, &$old_signals = null): bool {}
30#endif
31
32#ifdef HAVE_STRUCT_SIGINFO_T
33#if defined(HAVE_SIGWAITINFO) && defined(HAVE_SIGTIMEDWAIT)
34/** @param array $info */
35function pcntl_sigwaitinfo(array $signals, &$info = []): int|false {}
36
37/** @param array $info */
38function pcntl_sigtimedwait(array $signals, &$info = [], int $seconds = 0, int $nanoseconds = 0): int|false {}
39#endif
40#endif
41
42function pcntl_wifexited(int $status): bool {}
43
44function pcntl_wifstopped(int $status): bool {}
45
46#ifdef HAVE_WCONTINUED
47function pcntl_wifcontinued(int $status): bool {}
48#endif
49
50function pcntl_wifsignaled(int $status): bool {}
51
52function pcntl_wexitstatus(int $status): int|false {}
53
54function pcntl_wtermsig(int $status): int|false {}
55
56function pcntl_wstopsig(int $status): int|false {}
57
58function pcntl_exec(string $path, array $args = [], array $env_vars = []): bool {}
59
60function pcntl_alarm(int $seconds): int {}
61
62function pcntl_get_last_error(): int {}
63
64/** @alias pcntl_get_last_error */
65function pcntl_errno(): int {}
66
67#ifdef HAVE_GETPRIORITY
68function pcntl_getpriority(?int $process_id = null, int $mode = PRIO_PROCESS): int|false {}
69#endif
70
71#ifdef HAVE_SETPRIORITY
72function pcntl_setpriority(int $priority, ?int $process_id = null, int $mode = PRIO_PROCESS): bool{}
73#endif
74
75function pcntl_strerror(int $error_code): string {}
76
77function pcntl_async_signals(?bool $enable = null): bool {}
78
79#ifdef HAVE_UNSHARE
80function pcntl_unshare(int $flags): bool {}
81#endif
82
83#ifdef HAVE_RFORK
84function pcntl_rfork(int $flags, int $signal = 0): int{}
85#endif
86