当前位置: 首页 > 文档资料 > Perl 入门教程 >

getpriority

优质
小牛编辑
118浏览
2023-12-01

描述 (Description)

此函数返回进程(PRIO_PROCESS),进程组(PRIO_PGRP)或用户(PRIO_USER)的当前优先级。

参数WHICH指定为PRIO_PROCESS,PRIO_PGRP或PRIO_USER之一设置优先级的实体,而WHO是要设置的进程ID或用户ID。 WHO的值为0定义了当前流程,流程组或用户。 这会在不支持系统getpriority()函数的系统上产生致命错误。

语法 (Syntax)

以下是此函数的简单语法 -

getpriority WHICH, WHO

返回值 (Return Value)

此函数在错误时返回undef,否则返回当前优先级。

<!--

例子 (Example)

Following is the example code showing its basic usage −

#!/usr/bin/perl

When above code is executed, it produces the following result −

-->