在UNIX不错,setpriority的区别 [英] Difference between nice and setpriority in unix
问题描述
我想实现不同的风味UNIX的C.我所看到的尼斯()系统调用和setpriority()调用的定义好的命令。尼斯()调用只递增/递减进程的优先级。如果我想一个进程的优先级设置为一个特定的值,我不能用漂亮的()调用?基本上,除了优先是如何修改等,有很好的()和setpriority任何区别()?
I'm trying to implement a different flavor of the 'nice' command of unix in C. I have seen the definitions of nice() system call and setpriority() call. The nice() call only increments/decrements the priority of the process. If I want to set the priority of a process to a particular value, can't I use the nice() call? Basically, other than how the priority is modified, is there any difference between nice() and setpriority() ?
推荐答案
这是历史性的。 尼斯()
长被引入之前 setpriority()
。为了向后兼容性,很好
功能被保留。
It's historical. nice()
was introduced long before setpriority()
. For backwards compatibility, the nice
function was retained.
这篇关于在UNIX不错,setpriority的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!