|
4 | 4 |
|
5 | 5 | /* Wait Constants */
|
6 | 6 |
|
| 7 | +namespace |
| 8 | +{ |
7 | 9 | #ifdef WNOHANG
|
8 | 10 | /**
|
9 | 11 | * @var int
|
|
995 | 997 | const PCNTL_ECAPMODE = UNKNOWN;
|
996 | 998 | #endif
|
997 | 999 |
|
998 |
| -function pcntl_fork(): int {} |
| 1000 | + function pcntl_fork(): int {} |
999 | 1001 |
|
1000 |
| -/** |
1001 |
| - * @param int $status |
1002 |
| - * @param array $resource_usage |
1003 |
| - */ |
1004 |
| -function pcntl_waitpid(int $process_id, &$status, int $flags = 0, &$resource_usage = []): int {} |
| 1002 | + /** |
| 1003 | + * @param int $status |
| 1004 | + * @param array $resource_usage |
| 1005 | + */ |
| 1006 | + function pcntl_waitpid(int $process_id, &$status, int $flags = 0, &$resource_usage = []): int {} |
1005 | 1007 |
|
1006 | 1008 | #if defined (HAVE_WAITID) && defined (HAVE_POSIX_IDTYPES) && defined (HAVE_DECL_WEXITED) && HAVE_DECL_WEXITED == 1
|
1007 |
| -/** @param array $info */ |
1008 |
| -function pcntl_waitid(int $idtype = P_ALL, ?int $id = null, &$info = [], int $flags = WEXITED): bool {} |
| 1009 | + /** @param array $info */ |
| 1010 | + function pcntl_waitid(int $idtype = P_ALL, ?int $id = null, &$info = [], int $flags = WEXITED): bool {} |
1009 | 1011 | #endif
|
1010 | 1012 |
|
1011 |
| -/** |
1012 |
| - * @param int $status |
1013 |
| - * @param array $resource_usage |
1014 |
| - */ |
1015 |
| -function pcntl_wait(&$status, int $flags = 0, &$resource_usage = []): int {} |
| 1013 | + /** |
| 1014 | + * @param int $status |
| 1015 | + * @param array $resource_usage |
| 1016 | + */ |
| 1017 | + function pcntl_wait(&$status, int $flags = 0, &$resource_usage = []): int {} |
1016 | 1018 |
|
1017 |
| -/** @param callable|int $handler */ |
1018 |
| -function pcntl_signal(int $signal, $handler, bool $restart_syscalls = true): bool {} |
| 1019 | + /** @param callable|int $handler */ |
| 1020 | + function pcntl_signal(int $signal, $handler, bool $restart_syscalls = true): bool {} |
1019 | 1021 |
|
1020 |
| -/** @return callable|int */ |
1021 |
| -function pcntl_signal_get_handler(int $signal) {} |
| 1022 | + /** @return callable|int */ |
| 1023 | + function pcntl_signal_get_handler(int $signal) {} |
1022 | 1024 |
|
1023 |
| -function pcntl_signal_dispatch(): bool {} |
| 1025 | + function pcntl_signal_dispatch(): bool {} |
1024 | 1026 |
|
1025 | 1027 | #ifdef HAVE_SIGPROCMASK
|
1026 | 1028 | /** @param array $old_signals */
|
1027 |
| -function pcntl_sigprocmask(int $mode, array $signals, &$old_signals = null): bool {} |
| 1029 | + function pcntl_sigprocmask(int $mode, array $signals, &$old_signals = null): bool {} |
1028 | 1030 | #endif
|
1029 | 1031 |
|
1030 | 1032 | #ifdef HAVE_STRUCT_SIGINFO_T
|
1031 | 1033 | #if (defined(HAVE_SIGWAITINFO) && defined(HAVE_SIGTIMEDWAIT))
|
1032 |
| -/** @param array $info */ |
1033 |
| -function pcntl_sigwaitinfo(array $signals, &$info = []): int|false {} |
| 1034 | + /** @param array $info */ |
| 1035 | + function pcntl_sigwaitinfo(array $signals, &$info = []): int|false {} |
1034 | 1036 |
|
1035 |
| -/** @param array $info */ |
1036 |
| -function pcntl_sigtimedwait(array $signals, &$info = [], int $seconds = 0, int $nanoseconds = 0): int|false {} |
| 1037 | + /** @param array $info */ |
| 1038 | + function pcntl_sigtimedwait(array $signals, &$info = [], int $seconds = 0, int $nanoseconds = 0): int|false {} |
1037 | 1039 | #endif
|
1038 | 1040 | #endif
|
1039 | 1041 |
|
1040 |
| -function pcntl_wifexited(int $status): bool {} |
| 1042 | + function pcntl_wifexited(int $status): bool {} |
1041 | 1043 |
|
1042 |
| -function pcntl_wifstopped(int $status): bool {} |
| 1044 | + function pcntl_wifstopped(int $status): bool {} |
1043 | 1045 |
|
1044 | 1046 | #ifdef HAVE_WCONTINUED
|
1045 | 1047 | function pcntl_wifcontinued(int $status): bool {}
|
1046 | 1048 | #endif
|
1047 | 1049 |
|
1048 |
| -function pcntl_wifsignaled(int $status): bool {} |
| 1050 | + function pcntl_wifsignaled(int $status): bool {} |
1049 | 1051 |
|
1050 |
| -function pcntl_wexitstatus(int $status): int|false {} |
| 1052 | + function pcntl_wexitstatus(int $status): int|false {} |
1051 | 1053 |
|
1052 |
| -function pcntl_wtermsig(int $status): int|false {} |
| 1054 | + function pcntl_wtermsig(int $status): int|false {} |
1053 | 1055 |
|
1054 |
| -function pcntl_wstopsig(int $status): int|false {} |
| 1056 | + function pcntl_wstopsig(int $status): int|false {} |
1055 | 1057 |
|
1056 |
| -function pcntl_exec(string $path, array $args = [], array $env_vars = []): bool {} |
| 1058 | + function pcntl_exec(string $path, array $args = [], array $env_vars = []): bool {} |
1057 | 1059 |
|
1058 |
| -function pcntl_alarm(int $seconds): int {} |
| 1060 | + function pcntl_alarm(int $seconds): int {} |
1059 | 1061 |
|
1060 |
| -function pcntl_get_last_error(): int {} |
| 1062 | + function pcntl_get_last_error(): int {} |
1061 | 1063 |
|
1062 |
| -/** @alias pcntl_get_last_error */ |
1063 |
| -function pcntl_errno(): int {} |
| 1064 | + /** @alias pcntl_get_last_error */ |
| 1065 | + function pcntl_errno(): int {} |
1064 | 1066 |
|
1065 | 1067 | #ifdef HAVE_GETPRIORITY
|
1066 |
| -function pcntl_getpriority(?int $process_id = null, int $mode = PRIO_PROCESS): int|false {} |
| 1068 | + function pcntl_getpriority(?int $process_id = null, int $mode = PRIO_PROCESS): int|false {} |
1067 | 1069 | #endif
|
1068 | 1070 |
|
1069 | 1071 | #ifdef HAVE_SETPRIORITY
|
1070 |
| -function pcntl_setpriority(int $priority, ?int $process_id = null, int $mode = PRIO_PROCESS): bool{} |
| 1072 | + function pcntl_setpriority(int $priority, ?int $process_id = null, int $mode = PRIO_PROCESS): bool{} |
1071 | 1073 | #endif
|
1072 | 1074 |
|
1073 |
| -function pcntl_strerror(int $error_code): string {} |
| 1075 | + function pcntl_strerror(int $error_code): string {} |
1074 | 1076 |
|
1075 |
| -function pcntl_async_signals(?bool $enable = null): bool {} |
| 1077 | + function pcntl_async_signals(?bool $enable = null): bool {} |
1076 | 1078 |
|
1077 | 1079 | #ifdef HAVE_UNSHARE
|
1078 |
| -function pcntl_unshare(int $flags): bool {} |
| 1080 | + function pcntl_unshare(int $flags): bool {} |
1079 | 1081 | #endif
|
1080 | 1082 |
|
1081 | 1083 | #ifdef HAVE_RFORK
|
1082 |
| -function pcntl_rfork(int $flags, int $signal = 0): int{} |
| 1084 | + function pcntl_rfork(int $flags, int $signal = 0): int{} |
1083 | 1085 | #endif
|
1084 | 1086 |
|
1085 | 1087 | #ifdef HAVE_FORKX
|
1086 |
| -function pcntl_forkx(int $flags): int{} |
| 1088 | + function pcntl_forkx(int $flags): int{} |
1087 | 1089 | #endif
|
1088 | 1090 |
|
1089 | 1091 | #ifdef HAVE_PIDFD_OPEN
|
1090 |
| -function pcntl_setns(?int $process_id = null, int $nstype = CLONE_NEWNET): bool {} |
| 1092 | + function pcntl_setns(?int $process_id = null, int $nstype = CLONE_NEWNET): bool {} |
1091 | 1093 | #endif
|
1092 | 1094 |
|
1093 | 1095 | #ifdef HAVE_SCHED_SETAFFINITY
|
1094 |
| -function pcntl_getcpuaffinity(?int $process_id = null): array|false {} |
1095 |
| -function pcntl_setcpuaffinity(?int $process_id = null, array $cpu_ids = []): bool {} |
| 1096 | + function pcntl_getcpuaffinity(?int $process_id = null): array|false {} |
| 1097 | + function pcntl_setcpuaffinity(?int $process_id = null, array $cpu_ids = []): bool {} |
1096 | 1098 | #endif
|
1097 | 1099 |
|
1098 | 1100 | #ifdef HAVE_SCHED_GETCPU
|
1099 |
| -function pcntl_getcpu(): int {} |
| 1101 | + function pcntl_getcpu(): int {} |
1100 | 1102 | #endif
|
1101 |
| - |
1102 | 1103 | #ifdef HAVE_PTHREAD_SET_QOS_CLASS_SELF_NP
|
1103 |
| -enum QosClass |
| 1104 | + function pcntl_getqos_class(): Pcntl\QosClass {} |
| 1105 | + function pcntl_setqos_class(Pcntl\QosClass $qos_class = Pcntl\QosClass::Default): void {} |
| 1106 | +#endif |
| 1107 | +} |
| 1108 | + |
| 1109 | +namespace Pcntl |
1104 | 1110 | {
|
| 1111 | + enum QosClass |
| 1112 | + { |
1105 | 1113 | case UserInteractive;
|
1106 | 1114 | case UserInitiated;
|
1107 | 1115 | case Default;
|
1108 | 1116 | case Utility;
|
1109 | 1117 | case Background;
|
| 1118 | + } |
1110 | 1119 | }
|
1111 |
| - |
1112 |
| -function pcntl_getqos_class(): QosClass {} |
1113 |
| -function pcntl_setqos_class(QosClass $qos_class = QosClass::Default): void {} |
1114 |
| -#endif |
|
0 commit comments