mirror of
https://github.com/php/php-src.git
synced 2026-04-05 07:02:33 +02:00
Fix test for proc_nice: bsd ps command didn't support option -o "%p %n"
This commit is contained in:
@@ -13,7 +13,7 @@ if(!function_exists('proc_nice')) die("skip. proc_nice not available ");
|
||||
<?php
|
||||
function getNice($id)
|
||||
{
|
||||
$res = shell_exec('ps -p ' . $id .' -o "%p %n"');
|
||||
$res = shell_exec('ps -p ' . $id .' -o pid -o ni');
|
||||
preg_match('/^\s*\w+\s+\w+\s*(\d+)\s+(\d+)/m', $res, $matches);
|
||||
if (count($matches) > 2)
|
||||
return $matches[2];
|
||||
|
||||
Reference in New Issue
Block a user