1--TEST--
2pcntl_setpriority() - Check for errors
3--EXTENSIONS--
4pcntl
5posix
6--SKIPIF--
7<?php
8
9require_once("pcntl_skipif_user_env_rules.inc");
10
11if (!function_exists('pcntl_setpriority')) {
12    die('skip pcntl_setpriority doesn\'t exist');
13}
14
15if (PHP_OS == "Darwin") {
16    die("skip This test is not for Darwin");
17}
18
19?>
20--FILE--
21<?php
22
23try {
24    $result = pcntl_setpriority(0, null, (PRIO_PGRP + PRIO_USER + PRIO_PROCESS + 10));
25} catch (ValueError $exception) {
26    echo $exception->getMessage() . "\n";
27}
28
29pcntl_setpriority(0, -123);
30
31?>
32--EXPECTF--
33pcntl_setpriority(): Argument #3 ($mode) must be one of PRIO_PGRP, PRIO_USER, or PRIO_PROCESS
34
35Warning: pcntl_setpriority(): Error 3: No process was located using the given parameters in %s
36