1
0
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:
reeze
2012-04-30 00:59:54 +08:00
parent 381edb425e
commit e52be10b30

View File

@@ -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];