⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 getpriority.2

📁 <B>Digital的Unix操作系统VAX 4.2源码</B>
💻 2
字号:
.\" SCCSID: @(#)getpriority.2	8.1	9/11/90.TH getpriority 2.SH Namegetpriority, setpriority \- get or set program scheduling priority.SH Syntax.nf.ft B#include <sys/time.h>#include <sys/resource.h>.PP.ft B#define PRIO_PROCESS	0	/* process */#define PRIO_PGRP		1	/* process group */#define PRIO_USER		2	/* user id */.PP.ft Bprio = getpriority(which, who)int prio, which, who;.PP.ft Bsetpriority(which, who, prio)int which, who, prio;.fi.SH Description.NXR "getpriority system call".NXR "setpriority system call".NXR "process" "getting scheduling priority".NXR "process" "setting scheduling priority"The schedulingpriority of the process, process group, or user, as indicated by.I whichand.I who,is obtained with the.PN getprioritycall and set with the.PN setprioritycall.The.I whichis one of PRIO_PROCESS, PRIO_PGRP, or PRIO_USER, and .I whois interpreted relative to .I which(a process identifier for PRIO_PROCESS, process groupidentifier for PRIO_PGRP, and a user ID for PRIO_USER).The.I priois a value in the range \-20 to 20.  The default priority is 0;lower priorities cause more favorable scheduling..PPThe.PN getprioritycall returns the highest priority (lowest numerical value)enjoyed by any of the specified processes.  The.PN setprioritycall sets the priorities of all of the specified processesto the specified value.  Only the superuser may lower priorities..SH Return ValuesSince.PN getprioritycan legitimately return the value \-1, it is necessaryto clear the external variable \fIerrno\fP prior to thecall, then check it afterward to determineif a \-1 is an error or a legitimate value.The.PN setprioritycall returns 0 if there is no error or\-1 if there is..SH DiagnosticsThe.PN getpriorityand.PN setprioritysystem calls fail under the following conditions:.TP 15[ESRCH]No processes were located using the .I whichand.I whovalues specified..TP 15[EINVAL]The.I whichwas not one of PRIO_PROCESS, PRIO_PGRP, or PRIO_USER..PPIn addition to the errors indicated above,.I setprioritycan fail under the following conditions:.TP 15[EPERM]A process was located, but neither its effective nor realuser ID matched the effective user ID of the caller..TP 15[EACCES]A user other than the superuser attempted to change a processpriority to a negative value..SH See Alsonice(1), fork(2), renice(8)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -