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

📄 syscalls_64.html

📁 Linux系统调用
💻 HTML
字号:
<!-- This HTML file has been created by texi2html 1.29
     from syscalls.texi on 4 June 1994 -->

<TITLE>Syscall specifications of Linux - getpriority</TITLE>
<P>Go to the <A HREF="syscalls_63.html" tppabs="http://personal.xfol.com/%7erezaie/syscall/syscalls_63.html">previous</A>, <A HREF="syscalls_65.html" tppabs="http://personal.xfol.com/%7erezaie/syscall/syscalls_65.html">next</A> section.<P>
<H2><A NAME="SEC64" HREF="syscalls_toc.html#SEC64" tppabs="http://personal.xfol.com/%7erezaie/syscall/syscalls_toc.html#SEC64">getpriority and setpriority</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>int getpriority(int <VAR>which</VAR>, int <VAR>who</VAR>);</CODE>
<P>
<CODE>int setpriority(int <VAR>which</VAR>, int <VAR>who</VAR>, int <VAR>prio</VAR>);</CODE>
<P>
<H3>PARAMETERS</H3>
<P>
<VAR>which</VAR>: [in] which kind of taks to work on.
<P>
<VAR>who</VAR>: [in] who exactly we want to work on.
<P>
<VAR>prio</VAR>: [in] the new priority.
<P>
<H3>DESCRIPTION</H3>
<P>
<CODE>getpriority</CODE> retreives the highest priority of a task, a process
group or a user and <CODE>setpriority</CODE> sets the priority of a task, all
process in a process group or a user. <VAR>which</VAR> and have the
following values:
<P>
<DL COMPACT>
<DT><CODE>PRIO_PROCESS</CODE>
<DD>to get the priority of a process. In this case <VAR>who</VAR> is a process id.
<P>
<DT><CODE>PRIO_PGRP</CODE>
<DD>to get the priority of a process group. In this case <VAR>who</VAR> is a
process group id.
<P>
<DT><CODE>PRIO_USER</CODE>
<DD>to get the priority of a user. In this case <VAR>who</VAR> is a user id.
</DL>
<P>
In any case, a value of zero for <VAR>who</VAR> means the current process,
process group or user. <VAR>prio</VAR> is in the range [-20,20] with lower
values giving a higher scheduling priority.
<P>
<H3>RETURN VALUE</H3>
<P>
<VAR>getpriority</VAR> returns something between -20 and 20.
<VAR>setpriority</VAR> returns 0 on success and -1 on error. In case of
errorm, <CODE>errno</CODE> is set to one of the following values:
<P>
<UL>
<LI><CODE>EINVAL</CODE>: <VAR>which</VAR> has an invalid value.
<LI><CODE>EPERM</CODE>: the effective uid and gid of the calling task do not
match those of the target task.
<LI><CODE>EACCESS</CODE>: the caller tried to lower a priority but is not a
superuser task.
<LI><CODE>ESRCH</CODE>.
</UL>
<P>
<P>Go to the <A HREF="syscalls_63.html" tppabs="http://personal.xfol.com/%7erezaie/syscall/syscalls_63.html">previous</A>, <A HREF="syscalls_65.html" tppabs="http://personal.xfol.com/%7erezaie/syscall/syscalls_65.html">next</A> section.<P>

⌨️ 快捷键说明

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